RIGHT Statement PDF
RIGHT Statement PDF
RIGHT$ Function
Purpose:
To return the rightmost n characters of string x$.
Syntax:
RIGHT$(x$,n)
Comments:
If n is equal to or greater than LEN(x$), RIGHT$ returns x$. If n equals zero, the null string
(length zero) is returned (see the MID$ and LEFT$ functions).
Examples:
10 A$="DISK BASIC"
20 PRINT RIGHT$(A$, 5)
RUN
BASIC
Prints the rightmost five characters in the A$ string.
file:///C|/Documents%20and%20Settings/Lorenzo/Desktop/GW%20Basic/RIGHTS.html28/03/2004 21.29.34
GW-BASIC User's Guide
LEN FUNCTION
Purpose:
To return the number of characters in x$.
Syntax:
LEN(x$)
Comments:
Nonprinting characters and blanks are counted.
Example:
x$ is any string expression.
10 X$="PORTLAND, OREGON"
20 PRINT LEN(X$)
RUN
16
Note that the comma and space are included in the character count of 16.
file:///C|/Documents%20and%20Settings/Lorenzo/Desktop/GW%20Basic/LEN.html28/03/2004 21.29.34