Specifications

Chapter 15. Function Reference
374
Syntax:
MID$(stringexpression,startposition[,stringlength])
Parameter:
startposition
A numeric expression which returns a value from 1 to 255.
stringlength
A numeric expression which returns a value from 0 to 255.
Description:
Starting from a position specified by startposition, MID$ extracts a portion of
a string specified by
stringexpression, by the number of characters specified
by stringlength.
A returned value of
MID$ depends upon the conditions as listed below.
MIDdle String function
MID$
Returns a portion of a given string expression from anywhere in the string.
Conditions Returned value
If
stringlength
option is omitted:
All characters from startposition to the end
of the string
Example:
PRINT MID$("ABC123",3)
If stringlength is
greater than the number
of characters contained
between
startposi-
tion
and the end of the
string:
All characters from
startposition to the end
of the string
Example:
PRINT MID$("ABC123",3,10)
If startposition is
greater than the length of
stringexpression:
Null string
Example: PRINT MID$("ABC123",10,1)
NOTE
BHT-BASIC does not support such MID$ function that replaces a part of a
string variable.
C123
C123