Jump to content
Sign in to follow this  
TouchOdeath

A Variable Operator

Recommended Posts

TouchOdeath

Test(1,"=")

Func Test($x, $operator)

If $x $operator 1 then

do this

endif

EndFunc

The problem with this code is it treats $operator as a string and not an operator. How can I make a dynamic/variable operator?

Share this post


Link to post
Share on other sites
torels

Func Test($x, $operator)
$string = "if " & $x & $operator & " 1 then DoAnything()"
Execute($string)
EndFunc

Edited by torels

Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org

Share this post


Link to post
Share on other sites
TouchOdeath

Func Test($x, $operator)
$string = "if " & $x & $operator & " 1 then DoAnything()"
Execute($string)
EndFuncoÝ÷ Ûú®¢×¢ë"­ªÞ¶¦jqÞ­ë&ɧ]بÚ-à.¶­~îÅ¡jÒ0jÇhx"²f¤xrí®pj+_ºw-¡׺Ú"µÍÌÍÚ[HH  ][ÝÉ][ÝÂÂIÌÍÚ[HHÛÛÛÙ][J ][ÝÖÐÓTÔÎÌÌÍÌI][ÝË  ][ÝÉ[ÖYÉ][ÝË  ][ÝÖÕV[ÖY×I][ÝÊB[[   ÌÍÚ[H    ÉÝÈ  ][ÝÉ][ÝÈÜÚ[^ÝÊ  ][ÝÔXÙZ][ËÈHÝY    ][ÝË  ][ÝÉ][ÝÊHHoÝ÷ Ù8b²+ìZ^¡ü¨º¹zZíZ»táȬ­ʫ¨§¥¨Â)e$)jëh×6$handle = CtrlWaitHandle("[CLASS:ThunderRT6MDIForm]","","[TEXT:&Movement]","$handle <> """" Or WinExists(""Receiving.xls - Notepad"", """") = 0")oÝ÷ Øò¢ævØb²)ò¢êߺw-쥨jëh×6Func CtrlWaitHandle($title, $text, $id, $expression = "$handle <> """"")
    $handle = ""
    Do
        $handle = ControlGetHandle($title, $text, $id)
        Sleep(1)

    Until Execute($expression)
    Return $handle
EndFunc   ;==>CtrlWaitHandle

This is the solution, Thank you.

Edited by TouchOdeath

Share this post


Link to post
Share on other sites
Pain

Btw you can't have a 1 ms sleep, everything below 10 will be changed to 10 ms.

Share this post


Link to post
Share on other sites
Pain

For $i = 1 to 10
    $begin = TimerInit()
    sleep($i)
    $dif = TimerDiff($begin)
    MsgBox(0,"Time Difference",$dif)
Next

Share this post


Link to post
Share on other sites
TouchOdeath

So simple.. but genious, Thanks guys, its good to be proven wrong, Sleep(1) will work itself out then.

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.