For some time, I've designated a certain self-created category of variables to start with the "@" symbol. For example,
@NTF_Symbols = "XXXXX,DFIHX"
@DFA_TF = 9.99
These variables types seemed to have worked fine for many years, but I just ran into two situations where they don't work:
If StrIndexNc(@NTF_Symbols, symbol, 1, @FWDSCAN) == 0 Then
NTF_Symbol = @FALSE
Else
NTF_Symbol = @TRUE
Endif
And:
my_string = "Value is $%@DFA_TF%"
In both cases, Winbatch seems to be treating them as variables that do exist but are empty ("").
Please help me understand this.
Can't reproduce the problem but it is not a good idea to use the "@" character as the first character of a variable name. This is because WIL constants and WIL extender constants begin with the "@" character and you could run into name collisions.
I tried them as well and they work for me. Guessing you are doing something to clear them out unless you what you post fails for you as well. Did you try the exact code you posted?
@NTF_Symbols = "XXXXX,DFIHX"
@DFA_TF = 9.99
symbol = 0
;These variables types seemed to have worked fine for many years, but I just ran into two situations where they don't work:
If StrIndexNc(@NTF_Symbols, symbol, 1, @FWDSCAN) == 0 Then
NTF_Symbol = @FALSE
Else
NTF_Symbol = @TRUE
Endif
;And:
my_string = "Value is $%@DFA_TF%"
message("HI",my_string)
message("HI",@NTF_Symbols)
Jim