SPLIT statement  

Purpose

Splits a string into two parts.

Syntax

SPLIT [WORD] MainStr, Part1Len TO Part1Var, Part2Var

Remarks

MainStr is separated into two parts, which are then assigned to the two string variables specified by Part1Var and Part2Var.  Part1Len is a numeric expression which specifies the number of characters to be assigned to Part1, while the remaining characters are assigned to Part2.

WORD

If the WORD option is included, PowerBASIC guarantees that Part1 will not end on a partial word.  This may require that Part1Len is adjusted to a smaller value.  In that case, Part2Var would be assigned these characters to compensate.  Depending upon the nature of the operation, it may be necessary to remove leading spaces from Part2Var.

See also

GRAPHIC SPLIT, LTRIM$, XPRINT SPLIT