Is it possible to pass a variable to #include file?

Is it possible to pass a variable to #include file?

Yes it is possible.
#include works like you copy-pasted the code in the place where you used #include.
So everything works normally:

varX = 5;
#include "your file.afl" // inside this file you will see varX with assigned value of 5

Having said that, it is not good programming style. Good programming is to use functions that you defined in your include file and call those functions with explicit arguments.

2 Likes

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.