this might be an incredibly stupid question but for the life of me I can't figure out if it is possible to implement optional parameters in SuperBasic. What I mean is something along these lines:
Code: Select all
def proc foo(bar$,goo$)
REM This I don't know how to do:
if is_empty(goo$) then goo$="default value"
end def
Code: Select all
foo "val_for_bar$"
Toolkit II has PARSTR$ which lets me implement what I want this way:
Code: Select all
def proc foo(bar$,goo$)
g$=PARSTR$(goo$,2)
if g$='' then g$='default value'
....
Are there any extensions or clever tricks in SuperBasic to check for undefined/empty parameter?
Thanks in advance for any tips or pointers to docs!