Skip to Content
0

multiple operators AND / OR

Sep 27, 2017 at 04:15 PM

30

avatar image

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
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Abhilash Kumar
Sep 27, 2017 at 05:29 PM
0

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

Show 1 Share
10 |10000 characters needed characters left characters exceeded

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

0