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

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

end

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

Thanks,
Nithin
#2
can i pass mutilple arameters(strings) in a function ..?
#3
1.
function $Inputdata

2.
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.
#4
Is it possible to check if any functions are running before starting a macro? If so, how is this done?

Thanks!
#5
To check whether current function is running, use getopt(nthreads):

Code:
Copy      Help
if(getopt(nthreads)>1)
,out "this function is already running"

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

Code:
Copy      Help
;/
function# $functionname

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

;EXAMPLE
;if(IsFunctionRunning("MyFunc"))

,;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
#6
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
Code:
Copy      Help
function# str'run1
#7
text will be stored into _command variable.

run1=_command


Forum Jump:


Users browsing this thread: 1 Guest(s)