Rewind code

Asked by Wei Yang

I would like to know if it is possible to rewind back to a certain previous line assuming if a "FindFailed" or any other exceptional kind of error occurred.

Please advice.

Thank you very much

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

SikuliX script "talks" Python language.

In your case you either have to use
- try: .. except: to catch exceptions
- if...:... else:...
- while:... for...:...

to script alternative or repetitive code depending on some conditions.

if not exists(someImage):
    # do something
else:
    # do something else

try:
    find(someImage)
    # do something
except FindFailed:
    # do something else

Can you help with this problem?

Provide an answer of your own, or ask Wei Yang for more information if necessary.

To post a message you must log in.