Page 1 of 1

Ternary operator

Posted: Wed Apr 08, 2020 4:46 pm
by StarBootics
Hello everyone,

I suggest to add the Ternary operator like in C or C++ to PB language.

Code: Select all

int c1 = (x0 > y0) ? 32 : 0;
This the Macro I'm currently using for that :

Code: Select all

Macro Interrogation(Variable, Test, If_True, If_False)
    
  If Test
    Variable = (If_True)
  Else 
    Variable = (If_False)
  EndIf 
    
EndMacro
Best regards
StarBootics

Re: Ternary operator

Posted: Thu Apr 09, 2020 1:21 pm
by User_Russian