save a file using streams

hi, i need a file-output when a dataport doesn’t find a matching number … so i thought about using the stream objects …the problem is : i tried the example for streams but i haven’t a automation-datatype in my globals … i think something with the licence and we have no for using this … then i wanted to use a normal file object and saw that their is also a posibility using streams together with files … but i didn’t understand how it works so has anybody a code example with this constellation ? *** quack ***

If you are in a dataport and going to write to the export file the data when the dataport doesn’t find a matching number, just use the CurrFile.WRITE method to write directly to the file. Look up more in HELP for understanding the specific syntax to use CurrFile.WRITE. One thing to double check first off is if you are in Attain trying to access Streams. (I made the unfortunate mistake a few weeks ago trying to program a Stream in v2.60 hehe). If you are in Attain, the way you want to set up the file would look something like this… file_object.WRITEMODE := TRUE; file_object.TEXTMODE := TRUE; file_object.CREATE(text_object_for_file_path); file_object.CREATEOUTSTREAM(stream_object); stream_object.WRITETEXT(insert_your_text_here); stream_object.WRITETEXT; //This writes a CR LF at the end of the last line. Remember you may wish to write a “file_object.CLOSE” at the end of your code, just for good housekeeping. Regards! Kristopher Webb Kelar Corporation, Canada