478
MID( ) Function
Return Substring
Format
MID(string$,offset[,len][,ERR=stmtref])
Where:
len
Length of the substring.
offset
Starting position of the substring. Numeric expression, integer. If the
integer is negative, the offset is taken from the end of the string.
stmtref
Program line number or label to transfer control to.
string$
String expression whose hash value is to be returned.
Returns
Extracted portion of string (similar to substring).
Description
Use the MID( ) function to extract a portion of a string. Using this function is similar
to using a substring, except that it can be used directly with the return value of a
function, variable or expression; e.g.,
->IF MID(MSE,22,1)>$00$ AND MID(MSE,22,1)<$FF$ THEN %WDX$="[WDX]"
In addition, if the offset is negative, ProvideX uses it as an offset from the end of the
string. For example, MID(X$,-1) is the last character of X$. If the length is negative,
then ProvideX uses it as the number of characters preceding the offset. That is,
MID("ABCD",-1,-1) returns C (the first character preceding the last character) and
MID("abcde",-2,-4) yields abc.
By default, if this function is passed an invalid offset, it returns a null string. If
passed an invalid length, then it returns the rest of the string.
Example
F_KSZ=DEC($00$+MID(FID(0),11,1))