Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to pass string in a function

while calling a function i would like to pass string which will be used in the function

Str Inputdata
; Function name = OpenApp
OpenApp Inputdata

; In Function OpenApp
function$ Inputdata

run "C:\.........exe"
LB_SelectString child("" "ThunderRT6ListBox" win("^xxxxxxx" "" "" 0x202) 0x1) Inputdata


iam facing praoblem in passing a string in a function whereas iam able pass an integer.. can anyone help on this..

can i pass mutilple arameters(strings) in a function ..?
function $Inputdata

function $Inputdata1 $Inputdata2 $Inputdata3

And don't use end, unless you want to end the macro. To end just the function, use ret, which is also not necessary in this case.
Is it possible to check if any functions are running before starting a macro? If so, how is this done?

To check whether current function is running, use getopt(nthreads):

Copy      Help
,out "this function is already running"

To check whether some other function is running, you need QM 2.1.7 or later. Function IsFunctionRunning:

Copy      Help
function# $functionname

;Returns 1 if function is running, 0 if not.


,;out "MyFunc is running"

int i n=EnumQmThreads(0 0 0 0)
ARRAY(QMTHREAD) a.create(n)
for i 0 EnumQmThreads(&a[0] n 0 0)
,_s.getmacro(a[i].qmitemid 1)
,if(_s~functionname) ret 1
how do i pass a str to an exe made with qm ??

windows command line
"C:\Users\Administrator\Desktop\test path.exe" "text"

first line of exe
Copy      Help
function# str'run1
text will be stored into _command variable.


Forum Jump:

Users browsing this thread: 1 Guest(s)