ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Reading IFS out of Order

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Reading IFS out of Order

    I have a program that is reading the IFS directory and then displaying on the screen.

    But if I do a WRKLNK... the files are in order... 08-16-11 : 08-17-11 : 08-18-11.. etc

    When the code runs
    eval pFile = readdir(pOpenDir)

    It actually has 08-17-11 first.

    Why isn't it reading the IFS in the correct date order?

    Do I need parms to Sort it? Do you pass the readdir parms for order?

    Thanks

  • #2
    Re: Reading IFS out of Order

    I'm not sure....
    could you just write the entries to a array--ed datastructure and sort prior to writing to screen?

    sorry for the quick fix option, but it might be quicker that figuring out the tuther...

    jamie
    All my answers were extracted from the "Big Dummy's Guide to the As400"
    and I take no responsibility for any of them.

    www.code400.com

    Comment


    • #3
      Re: Reading IFS out of Order

      As this example uses SQL, you can easily sort it into any sequence you want.



      or here

      Regards

      Kit
      http://www.ecofitonline.com
      DeskfIT - ChangefIT - XrefIT
      ___________________________________
      There are only 3 kinds of people -
      Those that can count and those that can't.

      Comment


      • #4
        Re: Reading IFS out of Order

        Thanks all, I will look into both options. Appreciate your time.

        Comment


        • #5
          Re: Reading IFS out of Order

          So what sequence is the IFS read in? FIFO, alpha or what?
          Bill
          "A good friend will bail you out of jail,
          A true friend would be sitting beside you saying,
          'Wow, that was fun.'"

          Comment

          Working...
          X