17.07.2013 Views

GWBASIC User's Manual

GWBASIC User's Manual

GWBASIC User's Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

GW-BASIC <strong>User's</strong> Guide<br />

WRITE# Statement<br />

Purpose:<br />

To write data to a sequential file.<br />

Syntax:<br />

WRITE #filenum, list of expressions<br />

Comments:<br />

filenum is the number under which the file was opened for output.<br />

list of expressions is a list of string and/or numeric expressions separated by commas or<br />

semicolons.<br />

The WRITE# and PRINT# statements differ in that WRITE# inserts commas between the items as<br />

they are written and delimits strings with quotation marks, making explicit delimiters in the list<br />

unnecessary. Another difference is that WRITE# does not put a blank in front of a positive<br />

number. After the last item in the list is written, a carriage return/line feed sequence is inserted.<br />

Examples:<br />

Let A$ = "CAMERA" and B$ = "93604-1". The following statement:<br />

WRITE#1, A$, B$<br />

writes the following image to disk:<br />

"CAMERA", "93604-1"<br />

A subsequent INPUT$ statement, such as the following, would input "CAMERA" to A$ and<br />

"93604-1" to B$:<br />

INPUT#1, A$, B$<br />

file:///C|/Documents%20and%20Settings/Lorenzo/Desktop/GW%20Basic/WRITEF.html28/03/2004 21.29.53

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!