Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
use A from commandline in if
#1
why does value == "destroy" not work ?

Code:
Copy      Help
function [$arg1] [$value]
str v = value

act win(mouse)
if (value == "destroy"); ja
if (v == "destroy"); ja    

;clo+
out _s.format("%s = %s" arg1 value)

and what exactly is _s ?

thanks
pi
#2
The type of the value variable is lpstr. When using == with a lpstr variable, it compares pointers to strings, not strings. To compare strings, use strcmp or q_stricmp. These functions return 0 if strings are equal. Or, use sel.

Code:
Copy      Help
if(!strcmp(value "destroy")) ja
;or
sel(value) case "destroy" ja

_s is local str variable. _i is local int variable. These variables are used without declaring.
#3
thanks for teaching me.

here is my result:
Code:
Copy      Help
function [$arg1]
act win(mouse)

sel(arg1)
,case "destroy" clo+
,case else clo

i trigger the function from strokeit, draw C for close and D for destroy window.

close window [C]
qmcl.exe M "close_window"
destroy window [D]
qmcl.exe M "close_window" A "destroy""

***
what about an alternative syntax for commandline ?
i have problems talking from a firefox extension to qm.
there is a problem with quotes.

qmcl.exe /pi_mode /close_window /destroy
pi
#4
how do i use
Quote:Q c Use c (any nonspace character) instead of " to enclose file, macro and command.
pi
#5
M "Macro"

|
v

Q ^ M ^Macro^
#6
thanks
pi


Forum Jump:


Users browsing this thread: 1 Guest(s)