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 />

PRINT Statement<br />

Purpose:<br />

To output a display to the screen.<br />

Syntax:<br />

PRINT [list of expressions][;]<br />

?[list of expressions][;]<br />

Comments:<br />

If list of expressions is omitted, a blank line is displayed.<br />

If list of expressions is included, the values of the expressions are displayed. Expressions<br />

in the list may be numeric and/or string expressions, separated by commas, spaces, or<br />

semicolons. String constants in the list must be enclosed in double quotation marks.<br />

For more information about strings, see the STRING$ function.<br />

A question mark (?) may be used in place of the word PRINT when using the GW-BASIC<br />

program editor.<br />

Print Positions<br />

GW-BASIC divides the line into print zones of 14 spaces. The position of each item printed is<br />

determined by the punctuation used to separate the items in the list:<br />

Separator Print Position<br />

, Beginning of next zone<br />

; Immediately after last value<br />

space(s) Immediately after last value<br />

If a comma, semicolon, or SPC or TAB function ends an expression list, the next PRINT statement<br />

begins printing on the same line, accordingly spaced. If the expression list ends without a comma,<br />

semicolon, or SPC or TAB function, a carriage return is placed at the end of the lines (GW-BASIC<br />

places the cursor at the beginning of the next line).<br />

A carriage return/line feed is automatically inserted after printing width characters, where<br />

width is 40 or 80, as defined in the WIDTH statement. This results in two lines being skipped<br />

when you print exactly 40 (or 80) characters, unless the PRINT statement ends in a semicolon.<br />

When numbers are printed on the screen, the numbers are always followed by a space. Positive<br />

number are preceded by a space. Negative numbers are preceded by a minus (-) sign. Singleprecision<br />

numbers are represented with seven or fewer digits in a fixed-point or integer format.<br />

file:///C|/Documents%20and%20Settings/Lorenzo/Desktop/GW%20Basic/PRINT.html (1 of 2)28/03/2004 21.29.31

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

Saved successfully!

Ooh no, something went wrong!