Is that all that is in the file?

by (Login burger2227)
R

You can open the file several ways, but to PRINT text you can either re-write the file information or append information to it:

OPEN "filename.txt" FOR OUTPUT AS #1 'creates new empty file only

OPEN "filename.txt" FOR APPEND AS #1 'add information

Opens a file and clears any previous data. Then use PRINT #1 to write new text or use WRITE #1 to put data in as comma separated string data:

PRINT #1, DATE$; TIME$ 'date and time are QB string functions

WRITE #1, DATE$, TIME$

CLOSE #1 closes a file after output.

These values can be read using OPEN file$ FOR INPUT AS #1 with LINE INPUT #1 for text values or INPUT #1, day$, hour$ with comma separated values.

Posted on Mar 5, 2012, 6:16 AM

Respond to this message   

Return to Index