Skip to Content

multiple operators AND / OR

Hello,

Could somebody explain me how to use multiple operators AND vs OR in this case:

Global StringVar Type ;
If UBound(myString)>=1
Then Type:= ToText(myString[1]);
Type := If Type = "F1A" Or Type = "F1E" Or Type = "F6A" Or Type = "F6E" Then "F";
Type := If Type = "G1A" Or Type = "G1E" Or Type = "G6A" Or Type = "G6E" Then "G";

Global StringVar Design ;
If UBound(myString)>=2
Then Design:= ToText(myString[2]);
Design := Replace (Design,"I","");
Design := If (Design = "20") and (Type = "F") Or (Design = "21") and (Type = "F") Or (Design = "22") and (Type = "F") Then "2" ;
Design
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Sep 27, 2017 at 05:29 PM

    Hi Zdenek,

    Please try:

    Global StringVar Type ;
    If UBound(myString)>=1
    Then Type:= ToText(myString[1]);
    Type := If Type IN ["F1A","F1E","F6A","F6E"] Then "F" Else If Type IN ["G1A","G1E","G6A","G6E"] Then "G";
    Global StringVar Design ;
    If UBound(myString)>=2
    Then Design:= ToText(myString[2]);
    Design := Replace (Design,"I","");
    Design := If (Design = "20" and Type = "F") Or (Design = "21" and Type = "F") Or (Design = "22" and Type = "F") Then "2" ;
    Design

    -Abhilash

    Add comment
    10|10000 characters needed characters exceeded