Darwinbots Forum

Bots and Simulations => DNA - General => Topic started by: abyaly on April 15, 2007, 07:23:25 AM

Title: Defvars with same name as sysvars
Post by: abyaly on April 15, 2007, 07:23:25 AM
I see in Blue on Blue that Jez defined a variable aimright, which can be used the same way as aimdx. When you define a variable that way, what happens? Are you no longer able to access the sysvar by its name? Or does it just not work?
Title: Defvars with same name as sysvars
Post by: Numsgil on April 15, 2007, 08:04:30 PM
Labels get converted to numbers in the program.  Multiple labels can point to the same number without interfering with one another.
Title: Defvars with same name as sysvars
Post by: abyaly on April 15, 2007, 10:29:32 PM
Quote from: Numsgil
Labels get converted to numbers in the program.  Multiple labels can point to the same number without interfering with one another.
The issue isnt with multiple labels pointing to the same numer. There is one label that is being assigned to more than one number.
Title: Defvars with same name as sysvars
Post by: Numsgil on April 16, 2007, 06:10:04 AM
Oh, I see now.  I don't think there's anything in the source code to specifically check for it.  Either one or the other will get preference, but which one depends on how the parser checks labels.  My guess is that the sysvar will take precedence and the def in the DNA will be obsoleted.