03-16-2021, 12:53 AM
I have created a program that have multiple sub-routines and I have a user defined function (UDF) that need to be called from the main body and from the sub-routines.
The manual and my tests told me that is not possible to call a UDF defined in the main body from a sub-routine.
I am currently obliged to define it multiple times, in the main body and in all sub-routines creating code duplication.
Do any of you have a work around ? (while still using UDF)
edit: I am searching for something equivalent to the C++ scoping "::" operator that would allow me to call the UDF defined in main space from a sub-routine space
The manual and my tests told me that is not possible to call a UDF defined in the main body from a sub-routine.
I am currently obliged to define it multiple times, in the main body and in all sub-routines creating code duplication.
Do any of you have a work around ? (while still using UDF)
Code:
! main body
...
100 DEF FNB(S8)=IP(FP(S8/2^6)*2) ! mask 00100000
105 IF FNB(S)=1 THEN ...
...
500 SUB DECODE(S9,B9,E9,C9,L9)
505 DEF FNB(S8)=IP(FP(S8/2^6)*2) ! duplicate code
510 IF FNB(S9)=1 THEN ...
...
540 END SUB
edit: I am searching for something equivalent to the C++ scoping "::" operator that would allow me to call the UDF defined in main space from a sub-routine space