String Functions
String !unctions diner from numeric functions in that they return
characters, graphics or numbers from a string (defined by quotation
marks) instead of a number
CHYME)
This function returns a string character whose ASCII code is X.
ERRS(N)
Returns string describing error condition N (see TRAP)
HEXS(N)
Returns a 4 character string containing Me hexadecimal representation
of value N (0 < N < 65535)
This returns the right-most X characters In XS.
MIDS(X$,N,X)
This returns a string containing X characters, starting from the Nth
character in XS M1D$ can also be used on the left side of assignment
statement as a pseudo-variable as well as a function. MID$ (string
variable. starting position, length) = source string.
This function reassigns values of positions (starting position) through
(starting position + length) of source string to me characters of string
variable in corresponding locations. Length defaults to the length of
string variables. and an error results if (starting position + length) is
greater than the length of the source string.
EXAMPLE
10 A$ ."14HE LAST GOODBYE":
20 PRINT AS
30 MIDS(AS,6,3)="ONG"
40
PRINT AS
R1GHTS(X$,X)
LEFTS(X$,X)
This returns a string containing the leftmost X characters of X$.
STAVE)
LEN(X$)
Returns the number of characters (including spaces and other symbols)
in me string X$
This returns a string which is identical to the PRINTed version 01 XS.
EXAMPLE'
AS=STII$(X)
150
15'
Need help?
Do you have a question about the Commodore 16 and is the answer not in the manual?
Questions and answers