It is currently Tue Jan 26, 2021 10:17 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Ternary operator
PostPosted: Wed Apr 08, 2020 4:46 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sun Jul 07, 2013 11:35 am
Posts: 587
Location: Canada
Hello everyone,

I suggest to add the Ternary operator like in C or C++ to PB language.
Code:
int c1 = (x0 > y0) ? 32 : 0;

This the Macro I'm currently using for that :
Code:
Macro Interrogation(Variable, Test, If_True, If_False)
   
  If Test
    Variable = (If_True)
  Else
    Variable = (If_False)
  EndIf
   
EndMacro

Best regards
StarBootics

_________________
The Stone Age did not end due to a shortage of stones !


Top
 Profile  
Reply with quote  
 Post subject: Re: Ternary operator
PostPosted: Thu Apr 09, 2020 1:21 pm 
Offline
Addict
Addict

Joined: Wed Nov 12, 2008 5:01 pm
Posts: 1131
Location: Russia
viewtopic.php?f=3&t=65088

_________________
Library XP_Menu_Lib - office menu; HID_Lib - USB Library
Torrent client - pbTorrent (source code); Create driver in PureBasic.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 14 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye