× 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.



Tom;

WRKLNK and windows sort the directories alphabetically before they display them to you. The API's read the links to them as they are written to disk, which I believe would be in the order they are created/linked to the parent directory.

I would create a procedure "readDirSorted" that would act like readDir except that it would read all of the directory entry pointers into an array, along with the directory entry name, sort the array by name and return the first directory pointer...

Duane Christen



-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Tom Deskevich
Sent: Thursday, December 16, 2010 9:12 AM
To: rpg400-l@xxxxxxxxxxxx
Subject: READDIR order question

I have done some research on this and I did not see any way you can set the order with a READDIR.
I also saw suggestions to read the directory and manipulate the order manually in the RPG program.

BUT, I still wanted to post something because I have never had this problem before and thought maybe somebody can shed some light on it.
When I list the contents of my folder in windows or with WRKLNK, it shows the entries in the correct order that I want to read them:

Opt Object link Type
. DIR
.. DIR
BK49_1 INDEX.pdf STMF
BK49_2 PG1-PG335_M > STMF
BK49_3 PG336-PG436 > STMF

But the READDIR process the . then the .. then BK49_3 ... then _2 then _1.

TIA

Tom Deskevich
INFOCON
814-472-6066
Fax 814-472-5019

As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.