Apple II User Manual

Page of 257
                Inputs a single character from the keyboard.
                If data is at the keyboard, it is put in the
                variable specified in the GET statement.
                If no data is available, the BASIC program
                will continue execution.
                GET can only be used as an indirect
                command.
STATEMENT       SYNTAX/FUNCTION                                         EXAMPLE
LEFT$           LEFT$ (string expression, length)                       310 PRINT LEFT$(X$,I)
                Gives the leftmost I characters of the string
                expression X$.  If I<=0 or >255 an FC
                error occurs.
STATEMENT       SYNTAX/FUNCTION                                         EXAMPLE
LEN             LEN (string expression)                                 220 PRINT LEN(X$)
                Gives the length of the string expression X$
                in characters (bytes).  Non-printing charac-
                ters and blanks are counted as part of the
                length.
STATEMENT       SYNTAX/FUNCTION                                         EXAMPLE
MID$            MID$ [string expression, start [, length])              330 PRINT MID$(X$,I)
                MID$ called with two arguments returns
                characters from the string expression X$
                starting at character position I.  If
                I>LEN(X$), then MID$ returns a null
                (zero length) string.  If I<=0 or >255,
                an FC error occurs,
                MID$ called with three arguments returns                340 PRINT MID$(X$,
                a string expression composed of the                     I,J)
                characters of the string expression X$
                starting at the Ith character for J characters.
                If I>LEN(X$), MID$ returns a null string.
                If I or J <=0 or >255, an FC error occurs.
                If J specifies more characters than are left
                in the string, all characters from the Ith on
                are returned.
STATEMENT       SYNTAX/FUNCTION                                         EXAMPLE
RIGHT$          RIGHT$ (string expression, length)                      320 PRINT RIGHT$
                Gives the rightmost I characters of the                 (X$,I)
                string expression X$.  When I<=0 or
                >255 an FC error will occur.  If
                I>=LEN(X$) then RIGHT$ returns all
                of X$.
STATEMENT       SYNTAX/FUNCTION                                         EXAMPLE
STR$            STR$ (expression)                                       290 PRINT STR$(X)
                Gives a string which is the character repre-
                sentation of the numeric expression X.
                For instance, STR$(3.1)="3.1."
STATEMENT       SYNTAX/FUNCTION                                         EXAMPLE
VAL             VAL (string expression)                                 280 PRINT VAL(X$)
                Returns the string expression X$ converted
                to a number.  For instance.
                VAL("3.1")=3.1.  If the first non-space
                character of the string is not a plus (+) or
                minus (-) sign; a digit or a decimal point (.)
                then zero will be returned.