Dr. Nick Posted May 3, 2006 Share Posted May 3, 2006 I am writing a library function that I wish to use with other scripts. The function performs some actions, waits for a little while, then should run a custom action specified by the calling script. I want to pass a callback function to the library function so it can run the caller's callback at the appropriate time. How could I do this? Thanks. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted May 3, 2006 Moderators Share Posted May 3, 2006 I may not be following... does Call() help you?I'm sure I'm not following either... You may want to look at Command Line Parameters and or EnvGet/EnvSet ... maybe even in the AutoIt Beta the StderrRead/StdoutRead/StdinWrite options Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Dr. Nick Posted May 3, 2006 Author Share Posted May 3, 2006 I may not be following... does Call() help you?Call() was exactly what I was looking for. Thanks!Along the same lines, is there a way to have a function run asynchronously from the rest of a script? Basically, I'd like to start a function which has an infinite loop that checks certain conditions, but at the same time, have another infinite loop running doing other things.Is that possible?Thanks again. Link to comment Share on other sites More sharing options...
Uten Posted May 3, 2006 Share Posted May 3, 2006 No "threaded" solution... but look at AdlibEnable() Lar.Just remember that the adlib (who came up with that name)? function will block execution of the main loop. AdlibEnable("cbAdlib", 333) loopit() exit Func loopit() while 1 ConsoleWrite("loopit - Before" & @LF) sleep(50) ConsoleWrite("loopit - After" & @LF) wend EndFunc Func cbAdlib() ConsoleWrite("cbAdlib - in" & @LF) sleep(300) ConsoleWrite("cbAdlib - out" & @LF) EndFunc You could take a look at the CoRoutine samples and create somthing running in diffrent processes. Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now