including subs with variable names
Posted: Fri Jul 28, 2017 1:37 am
Hello programmers
As I start to move subroutines out of my original program, I encountered this problem with variable subroutine names:
(The current directory is correctly set)
so this works:
but this doesnt:
I get: K:\...\Code\{%MYSUB}.prg not found on disk.
Also building the filepath instead did not work. It appears file paths cannot contain replacement strings.
Does anyone know the answer?
As I start to move subroutines out of my original program, I encountered this problem with variable subroutine names:
(The current directory is correctly set)
so this works:
Code: Select all
include MYSUB_USCode: Select all
%Country ="US"
%MYSUB ="MYSUB_"+%Country
include {%MYSUB}Also building the filepath instead did not work. It appears file paths cannot contain replacement strings.
Does anyone know the answer?