Not sure what I was thinking. Thought that maybe vars in a gosub were local to the sub.

Give the script a go with 4.22b1 as there was a memory issue with Dir() that got addressed.
quote:
Fixes/enhancements in 4.22:
- Fixed: bug in Dir() could cause memory overwrite

http://www.kixtart.org/board/ultimatebb.php?ubb=get_topic;f=3;t=000412
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.