08-15-2023, 06:44 PM
Mark
If you simple have mid$ function
which is as you know with pre-defined numbers of arguments
in MID$ they are 3 ( string, position, size)
but in Function we don't know number of arguments...right?
BUT
IF function is declared let say DEF_FN fnName( arg1, arg2, arg3 ,....)
or auto - declared or pre-processed then we are on the HORSE
or horze
he he i will blow --,my bad english ..sorry
so what is the first
in pseudo-code:
1.
then :
2. extract arguments like strings
and store it into string array or "argument list"
count number of arguments -> nArgs
Maybe use UDT to store data about function or use arrays
i used arrays but UDT should be fine to...
did i miss something ?
maybe some other members have some ideas?
If you simple have mid$ function
which is as you know with pre-defined numbers of arguments
in MID$ they are 3 ( string, position, size)
but in Function we don't know number of arguments...right?
BUT
IF function is declared let say DEF_FN fnName( arg1, arg2, arg3 ,....)
or auto - declared or pre-processed then we are on the HORSE
or horze
he he i will blow --,my bad english ..sorry
so what is the first
in pseudo-code:
1.
Code: (Select All)
IF nexttoken$ (pos+1 ) <> " ) "
' continue...it is function
ELSE
' it is subroutine
END IF
2. extract arguments like strings
and store it into string array or "argument list"
count number of arguments -> nArgs
Maybe use UDT to store data about function or use arrays
i used arrays but UDT should be fine to...
Code: (Select All)
userFuncName$ ( index) = fnName$
userFuncID % (index) = position% ' address in code
userFuncNumArgs% (index) = nArgs%
for i = 1 to nArgs
userFuncArgList$ (index) = argName$
Next i
did i miss something ?
maybe some other members have some ideas?
micro(A)developer
http://basic4us.epizy.com/forum/index.php
http://basic4us.epizy.com/forum/index.php