> read-directory-messages: func [
>     "Read a directory of XML-formatted standard messages with the
directory
> determined by messageType."
>     message-directory [block!] "A block of file names corresponding to a
> directory of XML-formatted standard messages."
> ][
>     message-block: copy []
>     foreach file-name message-directory [
>         file-contents: read file-name
>          insert message-block file-contents
>     ]
> ]
>
> But using the above function, I get files showing up in the block out of
> order. Am I doing something wrong?

I suspect all you need is to sort the message-directory block. Probably as
simply as adding the following line

   sort message-directory

You'll get your messages in reverse order because you are inserting at the
head of the block each time.

Alternatively, after sorting do the foreach on the "head reverse" of the
message block and insert at the tail of your result.

Brett.

-- 
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the 
subject, without the quotes.

Reply via email to