Jump to content
Sign in to follow this  

inline if?

Recommended Posts

is there anything i can use in autoit like the c/c++ inline if?


What i want to do is something like

Execute('Msgbox(0 , "" , Random(0,1,1)?"Yes":"No")')

P.S.: i need the execute and no i can't use "If"


i found a way... not exactly what is was looking for but will do the work

Execute('Msgbox(0 , "" , lif(Random(0,1,1) , "aa" , "bb"))')

Func lif($cond , $ret , $ret2 = "")
    If $cond Then Return $ret
    Return $ret2
Edited by Xand3r

Only two things are infinite, the universe and human stupidity, and i'm not sure about the former -Alber EinsteinPractice makes perfect! but nobody's perfect so why practice at all?http://forum.ambrozie.ro

Share this post

Link to post
Share on other sites

Have a look at _Iif($fTest, $vTrueVal, $vFalseVal) in the help file. This is more or less the function you wrote yourself.

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...