Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error Handling
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
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.
Suppose I have nested loop If any error occur


How I can sign out out application

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

Search the help file.
Several examples are in Help.
We could help you better if you post your macro, with comments.
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)
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)

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"
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.

Macro Macro1466
Copy      Help
run "notepad"
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"
,out "close Notepad"
,clo "Notepad"

Forum Jump:

Users browsing this thread: 1 Guest(s)