I have a procedure that will optionally take a message and redirect it to a log file. The issue is that the log file is not always available depending on the situation. I'd like to be able to test if the stream is open and then only write the message if it is, otherwise I get error 1387.
I've been through the documentation and have searched the KB, but haven't found anything.
if seek(stream) ne ? then "STREAM is open".
if seek(stream) ne ? then "STREAM is open".
Yes, wouldn't it be nice if the "stream handle" were a real handle with properties and methods to test these kinds of things, instead of just something to pass around. Things like (just suggestions):
IS-OPEN
DIRECTION (input/output)
SOURCE (if an input stream)
DESTINATION (output stream)
SEEK (or something similar to tell you how far you are in reading an input stream)
OUTPUT-SIZE (how big is the file we've written so far. This would be nice to have on the SAX-WRITER as well)
There are others that would be useful, but you get the idea.
I didn't know you could use SEEK like that.
I was honestly expecting something like this as well.
It turns out that I could use the CATCH exception handling to trap this error as well, but the SEEK solution is cleaner-looking.