Found a situation, which has intermittently plagued me for several years now, reproducible in C6 and C11.
Simple #IF( %sym ) which is being used to see if a value is present or not will resolve to false when it should resolve to true.
Its intermittent, could go weeks or months without seeing the problem and then suddenly I get it every time I run through a test and then it just starts working again. A reboot makes it work again.
When it resolves to false incorrectly, the actual value appears to be null and not zero.
I’m going to see if I can use IsNull( %sym ) in the #If() statement because I get nothing back, like a blank string when its should be zero.
I know not all clarion language functions can be used with template language code, but what appears to be a blank string using #Error could be the null like state of a variable.
That then means a 3rd state has been introduced to a True/False logic test and fails by defaulting to False. Technically its true or correct, but its not.
I might see what some Ai’s think to this idea and see what it comes up with.
Potentially its an attack vector, that DAB’s defensive coding wont pick up in a programming language, but this asserts the %sym is in a null state and IsNull may not always be available in a programming language.
Its causing an intermittent duplicate entry in my class writing template as highlighted in red.
Its an intermittent bug which I havent got to the bottom of what causes it, so for now the message will be sufficient.
I only got to the bottom of the fact the %sym appears to be null just the other day so hopefully this should be sufficient, but the existence of VarExists() says alot about how symbols & scope are handled.