× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On Fri, 4 Jan 2002, Scott Klement wrote:

> Here's an example (in RPG IV) of using option c.  You might also find it
> helpful to go to  http://archive.midrange.com/rpg400-l/index.htm
> and search for "opendir" or "Qp0lProcessSubtree" for other examples.
> In fact, searching the archives for this list might also be helpful...
>
> but... at any rate, here's the example code:

[code snipped]

Wow, that looks like a lot of code.  Almost all of it is D specs defining
variables and functions.  That stuff is #include'd in my C version, which
I think makes the C code more readable.  Are there C include file
equivalents for RPG?  I know you can use /INCLUDE and /COPY, but that's
not what I'm referring to.  I mean system supplied header files that make
all the D spec stuff unnecessary.  So you could just do something like:

D/INCLUDE types.h
D/INCLUDE dirent.h

Of course I guess it would be nice if RPG supported typedef, too (maybe it
does?).

For the original question asked by the poster, I wonder if it would be
easier to code the IFS stuff in C and then make it a bound procedure for
the RPG program?  You could make your own function called
'change_directory' that would be a C function to do the chdir() API
and another function to list the files.  That would be pretty easy I
think.

James Rich
james@eaerich.com




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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.