9 17 CHECKSTRING

LANSA Technical

9.17 CHECKSTRING

Þ Note: Built-In Function Rules.

Checks a string contains only allowable characters.

For use with

LANSA for i

YES

Visual LANSA for Windows

YES

Visual LANSA for Linux

YES

 

 

Arguments

No

Type

Req/ Opt

Description

Min Len

Max Len

Min Dec

Max Dec

1

A

Req

String to be checked

1

Unlimited

 

 

2

A

Req

List of allowable characters

1

256

 

 

 

 

Return Values

No

Type

Req/ Opt

Description

Min Len

Max Len

Min Dec

Max Dec

1

A

Req

Return okay code (Y/N)

Y = only contains specified characters

N = contains other characters

1

1

 

 

 

 

Technical Notes

Alpha fields always contain trailing blanks up to the length of the field. These trailing blanks need to be considered if you use Alpha fields when using this BIF. If trailing blanks are permitted in the String to be checked, then a blank must be provided in the list of allowable characters.

A literal may be used for the List of allowable characters.

If an Alpha field is used for the List of allowable characters, it may contain trailing blanks. For example

USE BUILTIN(CHECKSTRING) WITH_ARGS(#STRING #ALLOW) TO_GET(#YN)
 

If #ALLOW is Alpha(2) with a value of 'A ', then characters A and blank are checked for in #STRING.

If #ALLOW contains 'AB', only characters A and B are checked for in #STRING. Any trailing blanks in #STRING will result in a return code of N (contains other characters).

Reminder - in RDMLX you may:

  • Use the intrinsic .Trim on the Built-In Function arguments to trim trailing blanks from field values.
  • Replace the CHECKSTRING Built-In Function with the ContainsOnly intrinsic. This intrinsic treats trailing blanks in Alpha fields as insignificant and handles DBCS characters.
  • Use fields of type String