| View previous topic :: View next topic |
| Author |
Message |
flypaper Contributor


Joined: 19 Oct 2001 Posts: 104
|
Posted: Thu Mar 28, 2002 2:59 pm Post subject: Question about BINFILE |
|
|
It doesn't appear that I can use both CREATE and WRITE in the same BINFILE COMMAND. Am I doing something wrong? Should this work?
| Code: |
BINFILE OPEN, 1, @path(%0)log.txt,CREATE|WRITE
BINFILE WRITE, 1, TEXT, Log file created at @DATETIME(h:nn am/pm) on @DATETIME(M/D/YY).
BINFILE CLOSE, 1
|
|
|
| Back to top |
|
 |
VDSuser Contributor


Joined: 21 Mar 2002 Posts: 58 Location: Somewhere in time
|
Posted: Sat Mar 30, 2002 4:49 pm Post subject: |
|
|
I assume LOG.TXT is purely an example as TXT files generally aren't binary.
Edit your first line to read "BINFILE OPEN, 1, @path(%0)log.txt,CREATE" to create and open the LOG.TXT file, then use your BINFILE WRITE statement to write to it.
If LOG.TXT already exists, don't use CREATE.
The VDS Help instruction "BINFILE OPEN,<file_id>,<filename>,READ|WRITE|CREATE" means you can use READ or WRITE or CREATE as a mode. (You can open a binary file to Read it, open a binary file to Write to it, or open a binary file to Create it if it doesn't exist.) You can't use more than one mode when OPENing.
Hope this helps.  |
|
| Back to top |
|
 |
flypaper Contributor


Joined: 19 Oct 2001 Posts: 104
|
Posted: Sun Mar 31, 2002 12:50 pm Post subject: |
|
|
| Well color me dumb. Thanks! |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|