Posts: 44
Threads: 12
Joined: Apr 2006
here is function1:
str a.getwintext(win("notepad 4070296 sample text"))
str b= the number in "notepad title" from str a
(basicaly I need only part of the title stored into str b)
every time I run this func the number will change.. I need to take that number from string a and put in str b
also need to know how to disable all folder, macros, ect from a macro.
also need to know how to enable, disable macro1 or folder1 from macro5
thanks in advance.
Posts: 1,769
Threads: 410
Joined: Feb 2003
what does the wintext look like?
is it "notepad 4070296 sample text".
Posts: 12,073
Threads: 140
Joined: Dec 2002
Read in Help about gett (some other functions also can be used, but gett is simplest) and dis.
Posts: 44
Threads: 12
Joined: Apr 2006
str a.getwintext(win("this Title")) (only partial title)
this is an example of how the whole title might be:
"Always the same 4060005 this text will change bla bla 123 bla" (the number will change too exept for the "40")
I need to take the 4060005 out of str a and store it in str b (no spaces)
Please show me an example of how to do this.
thanks for your quick replys, greatly appreciated
Posts: 1,769
Threads: 410
Joined: Feb 2003
str a="Always the same 4060005 this text will change bla bla 123 bla"
str b
b.gett(a 3)
out b
Posts: 44
Threads: 12
Joined: Apr 2006
perfect. thanks.
now I need a command that checks if another instance of function1 is already running.
Need to make sure function1 is not running multiple times at once.
Posts: 12,073
Threads: 140
Joined: Dec 2002
You can set it in function's Properties dialog (QM 2.1.8 and later).
Posts: 44
Threads: 12
Joined: Apr 2006
thanks.
How about a "if" command in func1 to see if func2, or func3, or func4 is running
sorry for the retard qestions. still learning.
Posts: 12,073
Threads: 140
Joined: Dec 2002
This question is not new in this forum.
Posts: 44
Threads: 12
Joined: Apr 2006
sorry I searched for it and cannot find the answer.
Posts: 1,769
Threads: 410
Joined: Feb 2003
Posts: 44
Threads: 12
Joined: Apr 2006
that wont work.
isnt there an if statement that will check to see if a certain function is running.
like:
if "func3 is running"
ret
Posts: 1,769
Threads: 410
Joined: Feb 2003
i gaurntee that'll work.
just have your function set the global variable to "i'm running" and then just before it ends have it set it to "I've stopped". Then you can just check the global variable at any time. if gv="I'm running" then "whatever" else "whatever else".
Posts: 12,073
Threads: 140
Joined: Dec 2002
Function IsFunctionRunning
;/
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