IFSTRCMP        Branch to label if two strings match

Top  Previous  Next

Syntax:

IFSTRCMP

[ string1 ]  [ string2 ]  goto  [ label ]

Alt Syntax:

IFSTRCMPI

[ string1 ]  [ string2 ]  goto  [ label ]

Arguments:

[ string1 ]

Variable or string defining first string to compare.

 

[ string2 ]

Variable or string defining second string to compare.

 

[ label ]

A valid label within the current script file which is branched to if the two strings match.

Options:

none

 

 

 

This script command compares two strings and branches to [ label ] if they are exactly the same.

 

Use the alternate IFSTRCMPI command to perform the same comparison but to ignore case during the comparison.

 

Consider the following example in which the script file accepts a string from an operator and compares it to see if it is valid.

 

PROMPT user_id "Enter your User ID"

IFSTRCMP user_id "BANK11" goto valid_user

 

Related Command(s): IFNSTRCMP, IFSUBSTR , IFNSUBSTR