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 USING Statement<br />

Purpose:<br />

To print strings or numbers using a specified format.<br />

Syntax:<br />

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

Comments:<br />

string expressions is a string literal or variable consisting of special formatting characters.<br />

The formatting characters determine the field and the format of printed strings or numbers.<br />

list of expressions consists of the string or numeric expressions separated by semicolons.<br />

String Fields<br />

The following three characters may be used to format the string field:<br />

! Specifies that only the first character in the string is to be printed.<br />

\n spaces\ Specifies that 2+n characters from the string are to be printed.<br />

If the backslashes are typed with no spaces, two characters are printed; if the<br />

backslashes are typed with one space, three characters are printed, and so on.<br />

If the string is longer than the field, the extra characters are ignored. If the field is<br />

longer than the string, the string is left-justified in the field and padded with spaces<br />

on the right. For example:<br />

10 A$="LOOK": B$="OUT"<br />

30 PRINT USING "!"; A$; B$<br />

40 PRINT USING"\ \"; A$; B$<br />

50 PRINT USING"\ \"; A$; B$;"!!"<br />

RUN<br />

LO<br />

LOOKOUT<br />

LOOK OUT!!<br />

file:///C|/Documents%20and%20Settings/Lorenzo/Desktop/GW%20Basic/PRINTUSING.html (1 of 4)28/03/2004 21.29.32

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

Saved successfully!

Ooh no, something went wrong!