|
<< Click to Display Table of Contents >> Navigation: 3. Script Language > Testing Commands > ITS. / NTS. - If Test Condition > ITS. / NTS. - If Test Condition |
MiniRobotLanguage (MRL)
ITS.Is Full Name Command
NTS.Is Full Name Command
To validate whether a given string follows the format of a full name, requiring at least a valid first name and a last name.
Intention
•Conditional Statement. To validate whether a given string follows the format of a full name, requiring at least a valid first name and a last name.
•Trimming: The command trims the input string to remove any leading or trailing spaces before validation.
•Name Part Validation: Ensures the input consists of multiple parts, typically at least two (first and last names), by checking for spaces.
•Minimum Parts: Validates that there are at least two separate parts, which are not empty, to consider the string as a valid full name.
•Multiple Parts: If a middle name is present, each part of the name is individually validated.
•Part-Specific Checks: Different validation criteria may be applied to different parts of the name (for example, first vs. last name).
•The ITS. command is designed to assess a string for its suitability as a full name in various applications, ensuring it includes the basic components.
•The NTS. command checks the inverse condition, confirming that the string is not formatted as a full name.
•Focus on Structuring: The validation emphasizes the structure and presence of necessary name parts rather than the format or character set of each part.
Important:
The Command does not account for cultural variations in naming conventions where full names might not adhere to the first-name-last-name structure
It assumes that a valid full name must be composed of at least two parts separated by spaces, which may not be universal.
Example Use Case:
TST.Generate PreName|GER|$$N01
TST.Get Lastname by Country|DEU|$$N02
$$N04=$$N01 $$N02
ITS.Is Fullname|$$N04
DBP.$$N04 is a valid Full Name.
ELS.
DBP.$$N04 is NOT a valid Full Name.
EIF.
ENR.
The result would be:
Dalwijenella Bauer is a valid Full Name.
Syntax
ITS.Is Fullname|P1 … ELS. … EIF.
NTS.Is Fullname|P1 … ELS. … EIF.
Parameter Explanation
P1 - The variable containing the name string to be validated as a full name.
Example
'***********************************
' ITS.-Sample
'***********************************
' Generate a first name and last name
TST.Generate PreName|GER|$$N01
TST.Get Lastname by Country|DEU|$$N02
' Combine them to form a full name
$$N04=$$N01 $$N02
' Validate the full name format
ITS.Is Fullname|$$N04
' Output the validation result
DBP.$$N04 is a valid Full Name.
ELS.
DBP.$$N04 is NOT a valid Full 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:
•