Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
newb err handling question
#1
Below is a simple macro to close an annoying notice board that pops up every now and then. I can't figure out why the "Window doesn't exist" line is never reached. I've tried different syntaxes, with and without the ;, err, err+, I just can't get the macro not to quit on me after the object isn't found. What am I doing wrong?

I
Code:
Copy      Help
Acc a=acc("" "CLIENT" win("SpeechQ Report Station" "WindowsForms10.Window.8.app.0.33c0d9d") "" "")
if(!a.a); err+
    out("Window doesn't exist")
else
    lef 2209 1785

When I first wrote this, the line read if(!a.a) ret, and that worked fine. But now I want to do that stuff if the object doesn't exist.

Please forgive my ignorance, I'm still very new at this.

DC
#2
Code:
Copy      Help
int w=win("SpeechQ Report Station" "WindowsForms10.Window.8.app.0.33c0d9d")
if w=0
,out "window doesnt exist"
else
,out "window exists"
,Acc a=acc("" "CLIENT" w "" "")
,if a.a
,,out "object found"
,else
,,out "object not found"
#3
Thanks, that did the trick.


Forum Jump:


Users browsing this thread: 1 Guest(s)