cancel
Showing results for 
Search instead for 
Did you mean: 

multiple operators AND / OR

former_member267979
Participant
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

abhilash_kumar
Active Contributor
0 Kudos

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

former_member267979
Participant
0 Kudos

super.....works nice

I already found and used if + multiple times else if instead of the OR , but Your style seems to be shorter record, so I will use it.

Thank You

Answers (0)