Posts: 1,271
Threads: 399
Joined: Mar 2003
why does value == "destroy" not work ?
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
Posts: 12,072
Threads: 140
Joined: Dec 2002
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.
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.
Posts: 1,271
Threads: 399
Joined: Mar 2003
thanks for teaching me.
here is my result:
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
Posts: 1,271
Threads: 399
Joined: Mar 2003
how do i use
Quote:Q c Use c (any nonspace character) instead of " to enclose file, macro and command.
Posts: 12,072
Threads: 140
Joined: Dec 2002
M "Macro"
|
v
Q ^ M ^Macro^
Posts: 1,271
Threads: 399
Joined: Mar 2003