#include by symbol

Posted By: Grat

#include by symbol - 07/20/20 12:03

Hi,

is a possible this construct?

#include strf("to%s.h",strx(Asset,"/",""))

thanks Milan
Posted By: AndrewAMD

Re: #include by symbol - 07/20/20 12:49

You cannot run a function in the preprocessor because the function is not available at compile time. That's very illegal.
Posted By: Grat

Re: #include by symbol - 07/21/20 05:37

Thanks. I trying other - read param from ini file. But not working this:

[ini file]
cSystem = "AlfaFF_01_"

[zorro script - OK]
cSystem = strtext(setup,"cSystem","WRONG");
printf("\n%s",cSystem); // OK, show the value from INI file

[zorro script - NOT OK]
void run(){
loadIniValue();
Script = cSystem; // this not "AlfaFF_01_
....
}
My question, is a possible use the "Script" in the variable?

Quote

Test: betaGen EUR/USD 2020
Assets Assets4
Error 062: Can't open EURUSD_EURUSD.c (rt:2)
Error 044: Data\EURUSD_EURUSD.c not trained
Error 047: No bars to plot


Error 62 - is correct, because data is under name AlfaFF_01__EURUSD.c not the EURUSD_EURUSD.c
Don't use the Script value - may be must be correct during the compilation?

Posted By: jcl

Re: #include by symbol - 07/21/20 05:57

You can set the Script variable, but with a normal string, not with a temporary string.
Posted By: Grat

Re: #include by symbol - 07/21/20 06:13

Thanks, work perfect. I every time forget the temporary string laugh
© 2024 lite-C Forums