Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error Handling
#1
some time Object not found error generated...
If this error occour. Macro is stop.
I want macro not stop.

Macro is stop only when log out / close web page
#2
code that generates error; err

Can add code to execute special on error as well. Search help file for "err".

Also search the help file for "opt" to find out how to turn errors off in a function completely.
#3
Suppose I have nested loop If any error occur

Then

How I can sign out out application

Give me example
#4
In loop...use break, or continue.

Search the help file.
#5
Several examples are in Help.
We could help you better if you post your macro, with comments.
#6
SUPPOSE
int rowCounts=es.NumRows

for iRow 1 rowCounts
es.GetCell(searchJobId 1 iRow)
if CellCheck(searchJobId)
Htm el_setJobId=htm("INPUT" "txtJobNumber" "" win("Vendor Solution - Windows Internet Explorer" "IEFrame") "2" 3 0x221)
el_setJobId.SetText(searchJobId)
out "JobId set focus"

My next step is to click submit button
Htm CmdFind=htm("INPUT" "btnFind" "" win("Vendor Solution - Windows Internet Explorer" "IEFrame") "2" 8 0x121)
CmdFind.Click

and When Invalid data is enter then Button not work. Macro cannot go forward next step and generate error "object not found"
How I can solve this problem.
........

I want to say, If searchJobId is Invalid. Then macro is running continue and go to for loop

Problem is when data is Invalid macro "object not found"
#7
Which line generates error?

To post QM code, copy it in QM using menu Edit -> Other Formats -> Copy For QM Forum. Because now tabs are lost.
#8
example

Macro Macro1466
Code:
Copy      Help
out
run "notepad"
1
int i
for i 0 3
,out "activate Notepad"
,act "Notepad" ;;throws error if Notepad not found
,err ;;handles the error
,,out "Notepad not found"
,,continue
,out "close Notepad"
,clo "Notepad"


Forum Jump:


Users browsing this thread: 1 Guest(s)