Variable Commands

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > Variable Definitions and Operations >

Variable Commands

IWC. / NWC. - If-Wildcard-Pattern Compare

Previous Top Next


MiniRobotLanguage (MRL)

 

IWC. Conditional Statement

If WildCard Pattern Compare

 

 

Intention

 

Conditional Statement.

Test if a specified string evaluates true with a given Wildcard Pattern.

Wildcard-Patterns use the following Patterns:

 

? - matches any single character

* - matches none or more of any characters

# - matches any single numeric character

 

 

$$TXA=*Peter

$$TXB=Hallo Peter

 

' Here comes the magic

IWC.$$TXA|$$TXB

 DBV.Yes, we match the Pattern.

EIF.

 

NWC. is the negative Form of this statement.

 

 

 

Syntax

 

 

IWC.P1|P2 … ELS. … EIF.

 

 

Parameter Explanation

 

P1 - Variable to compare with

 

P2 - Variable with Pattern

 

 

Important: Only P1 can be a Pattern.

 

 

IWC.'s can be nested to unlimited Depth, and they can also enclose Sub-Programm Calls or FEX. (Enumerations) to unlimited Depth.

 

 

 

 

Example

 

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

' IWC.-Test

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

$$TXA=*Peter

$$TXB=Hallo Peter

 

IWC.$$TXA|$$TXB

 DBV.Yes, we match.

EIF.

END.

 

 

 

Remarks

 

-

 

 

Limitations:

 

-

 

 

See also:

 

    1.6.1. Program Flow Control

    1.5. Features and Hints

    IVP./ NVP. - If-Variable-Pattern

    IVC. / NVC. - If-Variable-Contains

    ELS. - ELSE

    EIF. - END IF

    CAL. - mathematical CALculation

    IVV. / NVV. - If Variable Value