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./NTS.Is EMail

Previous Top Next


MiniRobotLanguage (MRL)

 

ITS.Is EMail

NTS.Is EMail

Test if a String can be a valid e-Mail

 

 

Intention

 

Conditional Statement.

Validate the structure of a provided string as a standard email address. Possibly a bit faster then the XP-Variant from ITS.Is EMail XP-Command.

Internally this command uses another technology.

 

Character Sets: Validates against the standard email character set, allowing letters, digits, hyphens, periods, and underscores.

Length Check: Ensures the local part and domain part of the email address do not exceed their respective lengths.

Syntax Verification: Confirms the presence of the @ symbol and at least one period in the domain part for a standard format check.

The NTS. command is the counterpart and checks that the string is not a valid email format.

 

Example Use Case:

 

TST.Generate Test Email||$$N04

ITS.Is EMail|$$N04

 DBP.$$N04 is a valid E-Mail.

ELS.

 DBP.$$N04 is NOT a valid E-Mail.

EIF.

ENR.

 

The result would indicate:

john.doe@example.com is a valid E-Mail.

 

 

Syntax

 

 

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

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

 

 

 

Parameter Explanation

 

P1 - The variable containing the email string to be validated.

 

 

 

Example

 

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

' ITS.-Sample

'***********************************
' Generate a test email and store in $$N04

TST.Generate Test Email||$$N04

 

' Validate the email format

ITS.Is EMail|$$N04

 

' Output the validation result

 DBP.$$N04 is a valid E-Mail.

ELS.

 DBP.$$N04 is NOT a valid E-Mail.

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: