How can I pass a constant into an Include file without losing its const property?
Include "CPU:Include.CR1X" Const PI = 3.141592654 Const PI_2 = PI * 2 BeginProg Scan (1,Sec,0,0) NextScan EndProg
Const PI_3 = PI * 3
[Version]C:\Campbellsci\Lib\Compilers\CR1000XComp.exe VERSION:CR1000X.Std.05.01 DATE:05/10/2021test.CR1X -- Compile Failed!
<Include.CR1X> line 1: Variable used in CONST expression.
If i declare PI_2 in the main program it works fine, but if i do the same (PI_3) in the include file i get a compile error. Is there any way to pass a constant into the include file?
Try with the Include after the other constant declarations.
Thanks. That of course helped.