Jump to content

holding a func in a var


Recommended Posts

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
Link to comment
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

Link to comment
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]

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...