Oxygen Basic
Programming => Problems & Solutions => Topic started by: José Roca on October 04, 2018, 05:48:59 PM
-
Please explain what "label" does as an attribute of function.
'===========================
'CALLING FUNCTION BY BY NAME
'===========================
' this is okay for short lists of procedures
function fa() label
print "A"
end function
function fb() label
print "B"
end function
function fc() label
print "C"
end function
sys FunPtr[3]<=(@fa,@fb,@fc)
string FunList=" 01 fa 02 fb 03 fc "
function CallByName(string name)
'===============================
sys a,b,pf
a=instr FunList," "+name+" "
if a then
b=val mid FunList, a-2,2
pf=FunPtr[b]
call pf
end if
end function
CallByName "fb"
-
label allows you to reference a function without using its full # signature.
But in this case, it is not necessary because the functions have no parameters and therefore the signature is empty.
-
And how to use it if they have parameters?