IFSTRCMP        Branch to label if two strings match

<< Click to Display Table of Contents >>

Navigation:  Robo-FTP User's Guide > Script Programming > Script Commands > All Script Commands >

IFSTRCMP        Branch to label if two strings match

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. Unlike the UPPER and LOWER commands, IFSTRCMPI does not change the case of the strings.

 

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

 

Note: The functionality of IFSTRCMP and IFSTRCMPI were erroneously reversed in previously releases of Robo-FTP but their current operation is as described in this document.

 

 

Related command(s): IFNSTRCMP, IFSUBSTR, IFNSUBSTR, UPPER, LOWER