>I think there is something I need to slow down. When I enter VFP, if I try to run the program, it may work or not. If it doesn't work, I just retry for a few times until it works. Is there something with AutoYield I need to do or some other things?
Doesn't seem to affect anything on mine. Are you running on a fast machine - the one I'm running my tests on is old & slow, if it is speed related I wouldn't see it, but I cant see anything that is speed critical in your code other than closing the port before the buffer's empty.
Len Speed