03-23-2023, 09:29 PM
Set up your functions to be LOAD_ONCE, like so:
$IF MYFUNC_FOO = UNDEFINED THEN
$LET MYFUNC_FOO = TRUE
Function Foo
Foo = 123
End Function
$END IF
The above can only load once (while your precompiler variable is undefined), and then it'll never load again (due to the $LET defining the variable). Like this, you assure that a routine only loads once and you avoid the glitches of trying to load it multiple times into your main program.
$IF MYFUNC_FOO = UNDEFINED THEN
$LET MYFUNC_FOO = TRUE
Function Foo
Foo = 123
End Function
$END IF
The above can only load once (while your precompiler variable is undefined), and then it'll never load again (due to the $LET defining the variable). Like this, you assure that a routine only loads once and you avoid the glitches of trying to load it multiple times into your main program.