Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
passing parameters from 1 exe file to another
#1
Hi
I have 2 (Quick Macro) exe files, A and B. I initiate A, and A initiates B, via a run command. When A is initiated, it opens an input box in which I insert a number.
My question is the following:
When B is initiated by A, I would like it to get the same number I gave to A. But I don't understand (and I tried help and forum) how is it done. How do I pass over parameters from one exe file to another exe file?
thanks
Moshe
#2
Code:
Copy      Help
;/exe
str s
inp- s
run "$my qm$\Macro678.exe" s

;BEGIN PROJECT
;main_function  Macro679
;exe_file  $my qm$\Macro679.exe
;icon  $qm$\macro.ico
;manifest  $qm$\default.exe.manifest
;res  
;on_before  
;on_after  
;on_run  
;flags  6
;end_hotkey  0
;guid  {67C0F6CB-FCB1-4CEB-97F7-CB131F7DEF1F}
;END PROJECT

Code:
Copy      Help
;/exe
str s=_command
mes s

;BEGIN PROJECT
;main_function  Macro678
;exe_file  $my qm$\Macro678.exe
;icon  $qm$\macro.ico
;manifest  $qm$\default.exe.manifest
;res  
;on_before  
;on_after  
;on_run  
;flags  6
;end_hotkey  0
;guid  {B97FFA0D-B3A1-449E-A03C-E4A76006BB1B}
;END PROJECT
#3
thanks a lot - it works! :-)
but now I would like to pass a couple of parameters
how would I do that??
#4
There is no way to simply pass multiple variables to an exe.

Exe1 can format command line with multiple variables (format()), and let exe2 parse it (tok()).

Or use a variable of an user-defined type. Let exe1 convert it to string (setstruct()), and let exe2 convert the string to variable (getstruct()).

Or exe1 can write the variables to the registry (rset()), and let exe2 get them from there (rget()). This probably is the simplest.
#5
thank you for offering that often 3 different solutions for one problem - it is very useful!
I, by the way, hesitate to mess up too much with the registry
I chose the first solution you offered, and found it very easy to understand and apply
thanks


Forum Jump:


Users browsing this thread: 2 Guest(s)