Function SET221A

LANSA

Function SET221A
* =======================================================
* Process ........: SET_221
* Function .......: SET221A
* Created on .....: 21/11/2001 at 12:12:37
* Description ....: Find the length of a string
* Version.........: 1
*
* Full Description: The purpose of this function is to
* show how the non-blank length of a string
* can be calculated in one line
*
* Disclaimer: The following material is supplied as
* sample material only. No warranty concerning the
* material or its use in any way whatsoever is
* expressed or implied.
*
* Minimum LANSA release: 8.0
*
* =======================================================
* Function control options
Function Options(*DIRECT)
*
* Group and field definitions
*
Define Field(#S_221STRG) Type(*CHAR) Length(30) Desc('String to find the length of')
Define Field(#S_221LEN) Type(*DEC) Length(3) Decimals(0) Desc('Length of the string')
*
Group_By Name(#S_GRPREQ) Fields((#STD_TEXTL *OUTPUT *NOID) #S_221STRG (#S_221LEN *OUTPUT))
*
* Mainline
*
*
Change Field(#S_221STRG) To(ABCDEF)
Change Field(#STD_TEXTL) To('''Press enter to calculate the length of the string using TCONCAT''')
Begin_Loop
Request Fields(#S_GRPREQ) Design(*DOWN) Identify(*DESC) Prompt_Key(*NO)
Use Builtin(TCONCAT) With_Args(#S_221STRG *BLANKS) To_Get(#S_221STRG #S_221LEN)
End_Loop