contents.gifindex.gifprev1.gifnext1.gif

StrExtract_Var

Purpose

Returns a substring of a string contained in a memory variable; optionally, modifies the memory variable by removing the substring.

Arguments

StrExtract_Var(

<string> // A quoted name of a memory variable.

, <start pos> // 1 to n.

, <num> // A number. See Notes.

, <mode> // Any combination of L and R and U. See notes.

)

Notes

See also StrExtract. StrExtract_Var will handle very long strings.

If <mode> contains "L", then <num> is interpreted as a length; otherwise, a position.

If <mode> contains "R", then operations are performed right-to-left; otherwise, left to right.

If <mode> contains "U", then the substring is removed from the memory variable; otherwise, no modification occurs.

Example

Assume contents of mvXX are "FileExpress". In the example the <start pos> (4) is counted from the right, so "r" is the starting position in the string. <num> is interpreted as a length (3), moving to the left, so "x" is the end position. The substring returned is "xpr". This substring is removed from the source.

StrExtract_Var(

'mvXX'

, 4

, 3

, 'LRU'

)

Returns: "xpr"; mvXX is now "Fileess".