Calling an include dynamically

Posted by jimr@rci.ca on 21-Feb-2020 22:13

Can I call an include by variable?

So instead of the ususal:

{someidr/myinclude.i}

This:

my-program = "somedir/" + someval + ".i".

{&my-program)   <-- this is the part I am not sure of

All Replies

Posted by Stefan Drissen on 22-Feb-2020 10:21

No.

Includes are resolved at compile time, so you /can/ use preprocessor values to determine which include to include.

Variables are resolved at run time.

This thread is closed