AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Get return value from compiled script

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Murp|e



Joined: 12 Jan 2007
Posts: 261
Location: Norway

PostPosted: Tue Jan 29, 2008 8:49 am    Post subject: Get return value from compiled script Reply with quote

How can this sort of thing be done:

Code:
GetNextNumber:
 NextNumber := dllcall("CompiledNumberGenerator.exe")
 msgbox, The next number is %NextNumber%.
return


In other words, I need one compiled script to be able to run another compiled script and retrieve a return value from it. I suppose it would be possible to store the return value in a temporary file/registry key, but ideally I would be able to do something similar to the way a dllcall works.

Also, since this will be a number generator for creating unique drawing numbers, I suppose it would be smart for the "calling script" to inform the "number generating script" that the creation of the next unique drawing number was successfull or not, in which case I should probably have both scripts running simultaneously and communicate. I'll search the forums for that sort of functionality and edit this post if I find anything...

Edit: I found a post titled Terminal Script for communication between scripts. Anyone have any ideas of how reliable this is? I need this to be a surefire solution.
Back to top
View user's profile Send private message Visit poster's website
Guest






PostPosted: Tue Jan 29, 2008 4:50 pm    Post subject: Reply with quote

Read about "Exit [, ExitCode]" on the help file.You will need it in the compiled script
Back to top
Murp|e



Joined: 12 Jan 2007
Posts: 261
Location: Norway

PostPosted: Wed Jan 30, 2008 1:24 pm    Post subject: Reply with quote

Thanks for the tip, I had no idea Exitapp had an optional return parameter and this is exactly what I was looking for. I suppose it would work, but I would like to have the option of returning a string..

Also, having the ability to "communicate" with another script would be a great feature. I could then do some checks to make sure the drawing number was really used and/or if the drawing file was successfully created. Perhaps I'll use a temporary file for the communication after all, it's not the prettiest solution but it is very flexible and makes for easy "maintenance" of the scripts.
Back to top
View user's profile Send private message Visit poster's website
Guest






PostPosted: Wed Jan 30, 2008 2:00 pm    Post subject: Reply with quote

Murp|e wrote:
Also, having the ability to "communicate" with another script would be a great feature.

Search for "IPC" on the forum,or read the "OnMessage" topic on the help file nad browse to the last script example.
Back to top
Murp|e



Joined: 12 Jan 2007
Posts: 261
Location: Norway

PostPosted: Thu Jan 31, 2008 9:47 pm    Post subject: Reply with quote

Brilliant! Thank you so much!
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group