ITS. / NTS. - If Test Condition

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > Testing Commands > ITS. / NTS. - If Test Condition >

ITS. / NTS. - If Test Condition

ITS. Is Lastname / NTS. Is Lastname Command

Previous Top Next


MiniRobotLanguage (MRL)

 

ITS.Is Lastname

NTS.Is Lastname

Test  if the input string is a valid last name

 

 

Intention

 

Conditional Statement. To assess if the input string is a valid last name, observing specific conventions for character content, length, and structure.

Length Constraints: Ensures the last name is within an acceptable length, typically between 2 to 50 characters.

Start and End Characters: Checks that the last name starts with an uppercase letter and ends with a letter.

Valid Characters Set: Restricts valid characters to letters, hyphens, apostrophes, and space characters.

Proper Use of Hyphens and Apostrophes: Verifies that hyphens and apostrophes are not at the beginning or end and are not consecutive.

Positional Validation of Special Characters: Hyphens and apostrophes must not be at the beginning or end of the name, nor can they occur in sequence.

 

The ITS. command focuses on the structural validation of a last name, ensuring that it adheres to common naming conventions.

The NTS. command determines that the provided string does not qualify as a valid last name based on the specified criteria.

 

Example Use Case:

 

TST.Generate LastName|GER|$$N02

ITS.Is Lastname|$$N02

 DBP.$$N02 is a valid last name.

ELS.

 DBP.$$N02 is NOT a valid last name.

EIF.

ENR.

 

The result could indicate:

Müller is a valid last name.

 

 

 

 

Syntax

 

 

ITS.Is Lastname|P1 … ELS. … EIF.

NTS.Is Lastname|P1 … ELS. … EIF.

 

 

 

Parameter Explanation

 

P1 - The variable containing the string to be validated as a last name.

 

 

 

Example

 

'***********************************

' ITS.-Sample

'***********************************
' Generate a last name

TST.Generate LastName|GER|$$N02

 

' Validate the last name format

ITS.Is Lastname|$$N02

 ' Output the validation result

 DBP.$$N02 is a valid last name.

ELS.

 DBP.$$N02 is NOT a valid last name.

EIF.

 

' End the script

ENR.

 

 

 

Remarks

 

-

 

 

Limitations:

ITS./NTS. can be nested to unlimited Depth, and they can also enclose Sub-Program Calls or FEX. (Enumerations) to unlimited Depth.

 

 

 

See also: