Well, actually, you don't include the DOS library directly. You include the SysUtils lib directly. Then depending on platform it will include the right implementation of findfirst/next. This way it works on Mac, Unix, Linux, Windows, etc...

On your question, can you give me a full blown example. I'm a bit lost as to what your wanting, and the one liner didn't do it for me . High level will work:

FindFirst()
CallScript(MyFunction)
FindNext()
ReturnToCallScript()

Then what you want the script to do and what your global records/objects/variables should be.