04-15-2017, 07:08 AM
There is a trick to use the OPEN command to test whether a file exists. The problem with that is that you need to guess at which stream was opened and close it, otherwise you'll get a "stream already in use error" further down the line. A CLOSE ALL command would be a useful way to solve that problem.
In fact, leaving streams open indefinitely is a bad idea anyway. Occasionally you may want to read from one file and write to another, but even then, I prefer to read data into a variable or array, close the stream and then write it to a new one. CLOSE ALL woild make our programs a little more robust.
Yes, you could fake it with a for ... next loop. Having such a command in yab itself would be faster.
In fact, leaving streams open indefinitely is a bad idea anyway. Occasionally you may want to read from one file and write to another, but even then, I prefer to read data into a variable or array, close the stream and then write it to a new one. CLOSE ALL woild make our programs a little more robust.
Yes, you could fake it with a for ... next loop. Having such a command in yab itself would be faster.