How to replace BEGIN SEQUENCE...BREAK...RECOVER for own errors?
Posted: Wed Sep 05, 2018 5:52 am
Hi!
In VO I used BREAK very often to 'jump to the end' if an error was detected from my own program, not only runtime errors.
I tried to use a switch which is set to false if an error occurs:
lok := true
if lOk
xxxx
if <some error>
cMsg = "..."
lOk := false
endif
endif
...
But in this construct I get errors for 'use of uninitialised variables' because the compiler doesn't know that if lOk is true, any initialisation is made.
In X# I use TRY ... CATCH... for Exceptions of .net and runtime, but don't know how to use RAISE and if this makes sense anyway.
Some guidance to the right track?
BR Kurt
In VO I used BREAK very often to 'jump to the end' if an error was detected from my own program, not only runtime errors.
I tried to use a switch which is set to false if an error occurs:
lok := true
if lOk
xxxx
if <some error>
cMsg = "..."
lOk := false
endif
endif
...
But in this construct I get errors for 'use of uninitialised variables' because the compiler doesn't know that if lOk is true, any initialisation is made.
In X# I use TRY ... CATCH... for Exceptions of .net and runtime, but don't know how to use RAISE and if this makes sense anyway.
Some guidance to the right track?
BR Kurt