Page 1 of 1

variable already exists

Posted: September 18th, 2019, 2:19 pm
by AriSilva
Look at the following code snipet:

PROC PPO73_NASCIMENTO
string x = maketext("%08d", $);
string x1 = x[1:4];
string x2 = x[5:2];
string x3 = x[7:2];

The compiler issues an error "The symbol name 'x1' is already in use", but there is no x1 variable whatsoever.
But if I write xx1 it works.
Is it prohibited in the language, having variables x and x1?

Re: variable already exists

Posted: September 18th, 2019, 5:59 pm
by aaronw
I copied and pasted the few lines you gave and it compiles for me, so you can definitely declare x and x1. When I declare x1 globally I get the error. Attach your project if you would like me to take a look.

Re: variable already exists

Posted: September 21st, 2019, 1:06 pm
by AriSilva
Thnaks Aaron,
Forget that, my fault.
One of my associates broke my rule of naming dictionary variables and used x1, x2, and x9.
The rule is
lnn_tttt
where l is a letter
nn is a number (could be any number of digits
ttt is a text with a minimum of 4 letters (can be more)
I really emphasize that, but... s..happens