Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
passing a variable to qm
well, i told this before ... i use qm with powerpro as a tandem.
my problem is that i want to pass an url as command to qm.

from powerpro its:

$(q) M "paster" "$(img)"

where $(q) is the qm exe path and $(img) an image url which i gonna paste into some web application.

the problem i face is escaping the command, because the img str is:

Copy      Help
<img src="" alt="ppro00.gif" border="0">

qm code for macro paster:
Copy      Help
str s=command
out s

qm is returning only img src, after that it thinks it is a new command ?

i can send single quotes instead and maybe replace them in qm with double quotes.

but is there maybe an easier way to pass a variable or command to qm ?

my reason to use both programs is that powerpro offers cool menus and i am also deep in their syntax.

you can see and read about my crazy stuff on:
Following info applies to QM 2.0.9, 03/29/2003.

Now in QM command line you can use C, followed by single space and command:

$(q) M "paster" C $(img)

Command here is not enclosed into quotes. It itself can contain quotes.
thank you !
what about :
$(q) M "paster" C1 $(img) C2 $(var) C3 something else

so that i can pass more variables to qm.

an another way would be that i use some letter as seperator and split
the string in qm ...
Good suggestion. Outcome is that now functions and macros started by command line can receive arguments. Example (pass 3 arguments: string, integer and double):

in PP:

Copy      Help
... M "macro" A "some string" 1 1.5
Copy      Help
... M "macro" A(SEP) some stringSEP1SEP1.5

in QM:

Copy      Help
function $s i ^d
thats pretty cool and works very fine.
it took me a small time to understand your example,
because i idiot included the M in my pp variable qm :roll:

so for ppro users my command looks like that :

initialize the qm path as variable at ppro start :
Copy      Help
qm = "'"C:\Programme\PowerPro\Quick Macros 2\qmcl.exe'" M"]
(M is included ...)

Copy      Help
$(qm) "tester" A "first string" 1 "second string"

to get the third variable (second string string) the qm code for tester is :
Copy      Help
function $string1 i $string2
mes m

Forum Jump:

Users browsing this thread: 1 Guest(s)