Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
storing part of string into variable
#1
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.
#2
what does the wintext look like?

is it "notepad 4070296 sample text".
An old blog on QM coding and automation.

The Macro Hook
#3
Read in Help about gett (some other functions also can be used, but gett is simplest) and dis.
#4
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
#5
Code:
Copy      Help
str a="Always the same 4060005 this text will change bla bla 123 bla"
str b
b.gett(a 3)
out b
An old blog on QM coding and automation.

The Macro Hook
#6
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.
#7
You can set it in function's Properties dialog (QM 2.1.8 and later).
#8
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.
#9
This question is not new in this forum.
#10
sorry I searched for it and cannot find the answer.
#11
try looking here
is a function currently running
An old blog on QM coding and automation.

The Macro Hook
#12
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
#13
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".
An old blog on QM coding and automation.

The Macro Hook
#14
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


Forum Jump:


Users browsing this thread: 3 Guest(s)