| View previous topic :: View next topic |
| Author |
Message |
Murp|e
Joined: 12 Jan 2007 Posts: 261 Location: Norway
|
Posted: Tue Jan 29, 2008 8:49 am Post subject: Get return value from compiled script |
|
|
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 |
|
 |
Guest
|
Posted: Tue Jan 29, 2008 4:50 pm Post subject: |
|
|
| 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
|
Posted: Wed Jan 30, 2008 1:24 pm Post subject: |
|
|
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 |
|
 |
Guest
|
Posted: Wed Jan 30, 2008 2:00 pm Post subject: |
|
|
| 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
|
Posted: Thu Jan 31, 2008 9:47 pm Post subject: |
|
|
| Brilliant! Thank you so much! |
|
| Back to top |
|
 |
|