NAME

mid$ - return a portion of a string

SYNOPSIS

v$ = mid$(StrExpr, NumExpr1[, NumExpr2])

DESCRIPTION

The function mid$ returns a string of characters of length NumExpr2 from StrExpr beginning at offset NumExpr1 in StrExpr.  If NumExpr2 is not specified, or if there are fewer than NumExpr2 characters following offset NumExpr1 in StrExpr, then all characters following offset NumExpr1 will be returned.  If NumExpr2 is equal to zero, or if NumExpr1 is greater than the length of StrExpr, then mid$ returns a null string. 

StrExpr may be any string expression.  NumExpr1 may be any integer expression with a positive value.  NumExpr2 may be any integer expression with a non-negative value. 

EXAMPLE

This example uses the mid$ function to select the middle portion of a string:
	x$ = "CLEVELAND, OHIO"
	print "DREAM"; mid$(x$, 6, 4)
The example produces the output
	DREAMLAND

SEE ALSO

left$, right$, mid$(stmt)

DIAGNOSTICS

An "Illegal function call" error occurs if either NumExpr1 or NumExpr2 is out of range. 

from The Basmark QuickBASIC Programmerís Manual by Lawrence Leinweber