Closed StephanWald closed 1 year ago
@StephanWald
Throw Verb allows following syntax: THROW str{,int}{,ERR=lineref}
. The example above doesn't match this definition.
https://documentation.basis.cloud/BASISHelp/WebHelp/commands/throw_verb.htm
I know we where talking a bit about weeks ago where it turned out that inside the methods the syntax is a bit different, without =lineref
. Are there other differences? Could you point me to the corresponding documentation?
TODO
'=' err=[LabelDecl]
in ThrowStatement
=lineref
should be an errorThe "err" in the sample is not meant to be the "err=" clause, but is the "ERR" builtin system variable that returns an error code.
You can play with it by doing something like this in the console:
>lkjlkj
!ERROR=20 (Syntax Error: lkjlkj)
>? err
20
>
ERR always returns the last BASIC error code. In the THROW sample it's simply used to pass on the original err code as is, instead of ERR any integer would be valid.
class public Sample
method public String write(String dr!)
seterr writeErr
PRINT dr!
methodret dr!
writeErr:
throw "There was some Error!",201
methodend
classend
Fixed
This is valid, THROW is resulting in the falsely flagged error on methodend: