17.07.2013 Views

GWBASIC User's Manual

GWBASIC User's Manual

GWBASIC User's Manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

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

LEFT$ Function<br />

Purpose:<br />

To return a string that comprises the left-most n characters of x$.<br />

Syntax:<br />

LEFT$(x$,n)<br />

Comments:<br />

n must be within the range of 0 to 255. If n is greater than LEN(x$), the entire string (x$) will be<br />

returned. If n equals zero, the null string (length zero) is returned (see the MID$ and RIGHT$<br />

substring functions).<br />

Example:<br />

10 A$="BASIC"<br />

20 B$=LEFT$(A$, 3)<br />

30 PRINT B$<br />

RUN<br />

BAS<br />

The left-most three letters of the string "BASIC" are printed on the screen.<br />

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

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

Saved successfully!

Ooh no, something went wrong!