Ternary

Something you want to see in a LiveCode product? Want a new forum set up for a specific topic? Talk about it here.

Moderator: Klaus

Post Reply
kevin11
Posts: 101
Joined: Thu Aug 11, 2011 5:02 pm

Ternary

Post by kevin11 » Tue Sep 06, 2011 11:22 am

Does LC support the ternary operator ?
And if not, when can you have it ready for me please ? ;)

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Ternary

Post by Klaus » Tue Sep 06, 2011 1:07 pm

Lazy typer! :lol:

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Ternary

Post by Mark » Sat Sep 10, 2011 12:20 am

Hi,

I think that would be something like this

Code: Select all

function iif theArg1,theValue1,theValue2
     if value(theArg1) then
          return theValue1
     else return theValue2
end iif
Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Post Reply