0% found this document useful (0 votes)
18 views2 pages

RIGHT Statement PDF

The document discusses the RIGHT$ and LEN functions in GW-BASIC. RIGHT$ returns the rightmost characters of a string, while LEN returns the length of a string in characters. Examples are provided to demonstrate the usage of each function.

Uploaded by

Raj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views2 pages

RIGHT Statement PDF

The document discusses the RIGHT$ and LEN functions in GW-BASIC. RIGHT$ returns the rightmost characters of a string, while LEN returns the length of a string in characters. Examples are provided to demonstrate the usage of each function.

Uploaded by

Raj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

GW-BASIC User's Guide

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

You might also like