GETSUBTEXT Function (BigText)

Retrieves part of a BigText variable.


[RetLength :=] BigText.GETSUBTEXT(Variable, Position[, Length])

Parameters

Variable

Type: Text or BigText

The subtext of the BigText that is retrieved. This is the actual text that is returned.

Position

Type: Integer

The position in the BigText variable that the subtext is to be retrieved from. If this parameter is less than one, then a run-time error occurs. If this parameter is greater than the length of the BigText variable, then an empty string is returned. If the value of this parameter plus the value of the Length parameter is greater than the length of the BigText variable, then the remainder of the BigText variable from the position specified by this parameter is returned.

Length

Type: Integer

The length of the subtext that should be retrieved. This parameter is optional. If this parameter is omitted the function retrieves a subtext that starts at Position and runs to the end of the BigText variable. If this parameter is less than 0, then a run-time error occurs. If the value of the Position parameter plus the value of this parameter is greater than the length of the BigText variable, then the remainder of the BigText variable from the position specified by this parameter is returned.

Type: Integer

The length of the string that is retrieved from the variable.

The first character in a BigText variable is position 1.

The following table shows examples of the GETSUBTEXT function.

Initial BigText variable Function call Result

ABCDEFG

BigText.GETSUBTEXT(MyVariable, 3, 2)

CD

ABCDEFG

BigText.GETSUBTEXT(MyVariable, 0, 4)

Error

ABCDEFG

BigText.GETSUBTEXT(MyVariable, 5, -2)

Error

ABCDEFG

BigText.GETSUBTEXT(MyVariable, 15, 4)

(empty string)

ABCDEFG

BigText.GETSUBTEXT(MyVariable, 4, 15)

DEFG

To delete the content in a BigText variable use the CLEAR Function.

CLEAR(BigText)

Community Additions

ADD
Show: