qb45advr.hlp (
Topic list)
WRITE # Statement Programming Example
◄QuickSCREEN► ◄Details► ◄Example► ◄Contents► ◄Index►
──────────────────────────────────────────────────────────────────────────────
WRITE# Statement Programming Example
The output from the following program illustrates the difference between
the WRITE # and PRINT # statements:
A$ = "VCR, remote control" : B$ = "$399.00"
OPEN "PRICES.DAT" FOR OUTPUT AS #1 'Open PRICES.DAT for writing
PRINT #1,A$,B$ 'Store A$ and B$ in first record with PRINT #.
WRITE #1,A$,B$ 'Store A$ and B$ in second record with WRITE #.
CLOSE #1
Sample Output
Use the QuickBASIC editor to see what the contents of the file PRICES.DAT
looks like:
1. From the File menu, choose the Open Program command.
2. Specify the file name PRICES.DAT in the dialog box.
3. After you are prompted to save the program, the contents of PRICES.DAT
will be displayed in the View window:
VCR, remote control $399.00
"VCR, remote control","$399.00"
4. To clear the View window, choose the New Program command from the
File menu.