qb45advr.hlp (
Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
PRINT # Statement Programming Example
◄QuickSCREEN► ◄Details► ◄Example► ◄Contents► ◄Index►
──────────────────────────────────────────────────────────────────────────────
PRINT # Statement Programming Example
This example shows the effects of using data delimiters with PRINT #.
CLS ' Clear screen
A$ = "CAMERA, AUTOFOCUS" : B$= "September 20, 1985": C$ = "42"
Q$ = CHR$(34)
OPEN "INVENT.DAT" FOR OUTPUT AS #1 'Open INVENT.DAT for writing
'Write A$, B$, C$ without delimiters.
PRINT #1, A$; B$; C$
'Write A$, B$, C$ with delimiters.
PRINT #1, Q$; A$; Q$; Q$; B$; Q$; Q$; C$; Q$
CLOSE #1
OPEN "INVENT.DAT" FOR INPUT AS #1 'Open INVENT.DAT for reading.
FOR I% = 1 TO 2 'Read first two records and print.
INPUT #1, First$, Second$, Third$
PRINT First$; TAB(30); Second$; TAB(60); Third$ : PRINT
NEXT
CLOSE #1
Sample Output
CAMERA AUTOFOCUSSeptember 20 198542
CAMERA, AUTOFOCUS September 20, 1985 42