FOLD


The FOLD function re-delimits a string by replacing spaces with attribute marks at positions defined by a length parameter.

 

COMMAND SYNTAX

FOLD(expression1, expression2)

 

SYNTAX ELEMENTS

expression1 evaluates a string to be re-delimited.
expression2 evaluates to a positive integer that represents the maximum number of characters between delimiters in the resultant string. 

 

NOTES

The FOLD function creates a number of sub-strings such that the length of each sub-string does not exceed the length value in expression2. Spaces are converted to attribute marks except when in enclosed in sub-strings. Extraneous spaces are removed.

 

EXAMPLES

The following examples show how the FOLD function delimits text based on the length parameter. The underscores represent attribute marks.

q = "Smoking is one of the leading causes of statistics"
CRT FOLD(q, 7)

Smoking_is one_of the_leading_causes_of_statist_ics

q = "Hello          world"
CRT FOLD(q, 5)
Hello_world

q = "Let this be a reminder to you all that this organization will not tolerate failure." 
CRT FOLD(q, 30)
Let this be a reminder to you_all that this organization_will not tolerate failure.

q = "the end"
CRT FOLD(q, 0)

t_h_e_e_n_d


jBC