Closed StephanWald closed 3 weeks ago
NOTE: The RETRUN with expression is mandatory between DEF FN...FNEND blocks. Outside DEF blocks, there is never a return value. Only spend time in this detail if it's easy to do.
@StephanWald RETURN and DEF FN...FNEND were implemented, but there is no validation like mentioned in your NOTE. I think we can easily check whether a RETURN is under a DEF.
Checking whether each path of a DEF contains a RETURN is a bit more complicated. One need to look at all control flow verbs and how they are nested in order to see where a path ends and therefore requires a RETURN. Not impossible, but also not so easy, I would say. What do you think @dhuebner and @msujew ?
RETURN parameter is optional, respectively only relevant when inside a DEF FN ...FNEND block
gosub lbl1
release
lbl1:
REM do somethin
PRINT ""
return
lbl2:
REM do something else
print ""
return
increasing the relevance since the recent "fix" of adding the parameter now breaks most samples from the docs, where RETURN is always used w/o parameter
@StephanWald
Issue with your last provided example is fixed in typefox-dev
.
It would be nice if you could check some of your example projects with the current state before release.
@StephanWald Merge PR to master is open. See #150
Fixed
or
https://documentation.basis.cloud/BASISHelp/WebHelp/commands/return_verb.htm