Applies To: |
|
Summary: |
I have defined an ASCII device in the
Device Definitions form, and I have put -1 in the No. Files field
which should mean that my text file keeps getting appended to each
time I write to this device. I have written some Cicode which I
call from a button. This code opens the device, writes to it, and
closes the device. But each time I push the button, the text file
it has generated only contains data from the previous code
execution. It has not been appended to. What am I doing wrong.
My test code looks like this: FUNCTION AddRecord() |
Solution: |
When you call DevOpen(), the device
pointer is at the top of the file. Hence, the subsequent
DevWriteLn()'s overwrite the existing text. You can add the
following lines to your code, so the pointer is placed at the end
of the file. Your code should look like:
FUNCTION AddRecord() |
Keywords: |
Related Links
Attachments