Sign in to follow this  
Followers 0
BillLuvsU

holding a func in a var

4 posts in this topic

Is is possible to hold a function in a variable like

$func = "msgbox(48,"Test","Test")
$func

[center][/center]Working on the next big thing.Currently Playing: Halo 4, League of LegendsXBL GT: iRememberYhslaw

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

No. But you can do it different.

You can put one function or a collection of functions inside a function.

Complicated? Not really.

MyFunc()

While 1
  ;Sleep a minute and then run the function.
   Sleep(1 * 60 * 1000)
   CheckBreakFastTime()
WEnd

Func MyFunc()
   msgbox(48,"Test","Test")
EndFunc

Func CheckBreakFastTime()
   If @HOUR = "08" AND @MIN = "30" Then
      Msgbox(64, "8:30","Time for breakfast!")
   EndIf
EndFunc
Edited by SlimShady

Share this post


Link to post
Share on other sites

Is is possible to hold a function in a variable like

$func = "msgbox(48,"Test","Test")
$func

<{POST_SNAPBACK}>

No, but you can hold the RESULTS of the function in a variable.

$file = FileOpen(C:\test.txt,0)
MsgBox(0,"Test","the file handle of c:\test.txt is: " & $file)

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post


Link to post
Share on other sites

its possible if you make a temp autoit file write the contents of the variable to it then run it


[font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]

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  
Followers 0