Ahhh, thanks so much.  Copied, saved, compiled, ran.

This is a great template!

Regards,

Jim Langston

-----Original Message-----
From: Scott Klement [mailto:klemscot@klements.com]

On Fri, 5 Apr 2002, Joel Fritz wrote:
>
> I spent an hour or so yesterday trying to find definitions for the
constants
> mentioned in the api doc.  Then I had to get back to work. <g>

STRSEU QSYSINC/SYS WAIT will show you the C defs...

>
> It's one of my pet peeves that a lot of the api documentation is C
oriented.
> Makes you think that no one thought anyone would want to call them from
RPG.
> Some things like executable macros and functions with variable argument
> lists don't necessarily translate into RPG easily.
>

Very true.   But, I think the reason that everything is C oriented is
because it is designed to work just like the Unix version.   I think the
hope was that by providing lots of functions that are compatable with
Unix, they'd be able to find converts from Unix to OS/400.

C is the primary programming language on Unix systems.  In fact, the
operating system itself is written in C.

At any rate, this whole thread got me really excited about QzshSystem().
(I have worked with waitpid() and the WIFxxxx macros before on FreeBSD,
which is a Unix-type OS, but had never heard of QzshSystem until you guys
mentioned it...)

To a geek like me, being able to run Unix commands in an RPG program is
an intoxicating idea :)

So, I put together an RPG program that works (more or less) the same
way as the sample C program from the Info Center manuals.  While the
program itself isn't terribly useful (it does an ls, which would be better
done with the opendir() and readdir() APIs) it's good as an example of
how to execute a QSHELL command from RPG.

Naturally, you'll want to split out some of the data into /copy members
and service programs, but it's just easier to post the example as all one
member, so here it is:

<SNIP>


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.