Strange situation with stem variable
Brought to you by:
rexx
Hello, I have a short script:
/ ------------------------------------------------- /
dati. = "";
dati.attr.1.1.perc = 25.78;
say "before initialization perc" dati.attr.1.1.perc;
perc = 123;
say "after initialization perc" dati.attr.1.1.perc;
/ ------------------------------------------------- /
results are:
before initialization perc 25.78
after initialization perc
That is, after initialization of normal variable "perc" the stem variable "dati.attr.1.1.perc" is cancelled.
Is this right?
I am using Regina Rexx version 3.9.1 5/4/2015 32 bit, in Windows 7 professional 64 bit.
My misunderstand!
Indeed it's the regular Rexx result. Because, before the instruction "say dati.attr.1.1.perc", "perc" is evaluated as a variable, now it exists, then the interpreter does the substitution with the value of "perc".
The corresponding variable "dati.attr.1.1.123" exists, caused by the initialization (dati. = ""), and is an empty string.
Without the "dati." initialization, the result is:
after initialization perc DATI.ATTR.1.1.123
and it's totally clear the mechanism of substitution.
I missed the effect of high level inizialization on stem variables.