BASIC Moves Development Studio
06/2005
Danaher Motion
24 Rev
E
M-SS-005-03l
2.2.10. String
Functions
Beginning with version 3.0, MC-BASIC supports all the common string
functions supported in standard BASIC. For detailed information on any of
the string functions (including examples), refer to the
SERVOSTAR
®
MC
Reference Manual
.
ASC(S,I)
Returns an ASCII character value from within a string, S, at
position, I.
BIN$(X)
Returns the string representation of a number (X) in binary
format (without the Ob prefix).
CHR$(X)
Returns a one-character string corresponding to a given ASCII
value, X.
HEX$(X)
Returns the string representation of a number (X) in
hexadecimal format (without the 0x prefix).
INSTR(I,SS,S)
Returns the position, I, of the starting character of a substring,
SS, in a string, S.
LCASE$(S)
Returns a copy of the string, S, passed to it with all the
uppercase letters converted to lowercase.
LEFT$(S,X)
Returns the specified number, X, of characters from the left-
hand side of the string, S.
LEN(S)
Returns the length of the string, S.
LTRIM$(S)
Returns the right-hand part of a string, S, after removing any
blank spaces at the beginning.
MID$(S,I,X)
Returns the specified number of characters, X, from the string,
S, starting at the character at position, I.
RIGHT$(S,X)
Returns the specified number of characters, X, from the right-
hand side of the string, S.
RTRIM$(S)
Returns the left-hand part of a string, S, after removing any
blank spaces at the end.
SPACE$(X)
Generates a string consisting of the specified number, X, of
blank spaces.
STR$(X)
Returns the string representation of a number, X.
STRING$(X,{S},{Y})
Creates a new string with the specified number, X, of characters,
each character of which is the first character of the specified
string argument, S, or the specified ASCII code, Y.
UCASE$(S)
Returns a copy of the string, S, passed to it with all the
lowercase letters converted to uppercase.
VAL(S)
Returns the real value represented by the characters in the input
string, S.