Posts: 49
Threads: 12
Joined: Feb 2007
i must be lost on is else! i am trying to write this code that is activated by a window trigger ,then it is going to click a button to receive a value! how do i get it to argue if the value is less than 1 make it 25 but if it's more than 1 just click ok? how would i format this?
thanks!
Posts: 1,769
Threads: 410
Joined: Feb 2003
if x <1
x=25
else
click ok
note if ix=1 it also clicks ok.
Posts: 49
Threads: 12
Joined: Feb 2007
thanks ken , i'll try that!
Posts: 49
Threads: 12
Joined: Feb 2007
it keeps giving me else without if err!!!
if x <1
x=25
else
click ok
note if ix=1 it also clicks ok.
is this the complete code? i replaced x with object window but it's not working!!!
Posts: 62
Threads: 19
Joined: Jan 2007
Is there command "click ok"? Use "object.DoDefaultAction" or "object.Mouse(1 2 2)"
Posts: 1,769
Threads: 410
Joined: Feb 2003
no this is not complete code you'll need to put in all your variables and your "results" code.
Posts: 49
Threads: 12
Joined: Feb 2007
well i have read reread and tried countless times , i guess i just don't get it! not a great big deal , i can use 2 button on my toolbar was just wanting it to work both from the websites button! anyway thanks again for your explaination!
Posts: 49
Threads: 12
Joined: Feb 2007
int hwnd=val(_command)
if w<99,999.99
w=100,000.00
else
dou 352 454
this is in a macro with window trigger! w is in a function
this is w str a.getwinclass(child(331 "98,000.00" 0x5))
this is my code so far what am i doing wrong? it keeps giving a syntax on the = ?
Posts: 1,769
Threads: 410
Joined: Feb 2003
but it doesn't look like your initializing the w variable. is this your whole code?
Posts: 49
Threads: 12
Joined: Feb 2007
yes , so far everything i have made has been trial an error! lol i'm so lost!
Posts: 1,769
Threads: 410
Joined: Feb 2003
first you need this
double w
this makes w a variable of type "double" which lets you have the ".99" part.
Posts: 1,769
Threads: 410
Joined: Feb 2003
also, if w is a string then you can't use "<". that's only for a number.
you can do it this way though.
str w
double z
z=val(w)
if z<99999.99
etc
Posts: 49
Threads: 12
Joined: Feb 2007
thanks again ken! i will prolly be revisiting this issue shortly!!!
Posts: 9
Threads: 0
Joined: Nov 2006
if x equals 1, then the else will kick in with that code.
if x < 1
do this
else
do that
If x equals 1, then it will "do that". if you want "do this" executed on x equalling 1, then you need to change the code to:
if x <= 1
do this
else
do that
Posts: 9
Threads: 0
Joined: Nov 2006
meanmuggin Wrote:int hwnd=val(_command)
if w<99,999.99
w=100,000.00
else
dou 352 454
this is in a macro with window trigger! w is in a function
this is w str a.getwinclass(child(331 "98,000.00" 0x5))
this is my code so far what am i doing wrong? it keeps giving a syntax on the = ?
your problem is that w is a string variable. you would first need to remove the commas from the string, then convert to a double, then compare to to a number without commas.
Posts: 49
Threads: 12
Joined: Feb 2007