ScumSoft, on Tue Aug 30, 2011 5:11 AM, said:
Def is the same as saying X points to Y, where as Dim says for every use of X treat it as Y.
So Dim Apple = a is saying when apple is used modify a instead.
and Def Banana=Apple{7} is saying when I say banana, what I really mean is Apple{7} so use that
Now when you declare a dim you can have multiple aliases for a single variable, but when you declare the use of define(def) your telling it to replace every usage of X with Y and if you also want it to replace Z with Y it wont work since its been assigned to replace X instead.
So to fix your issue assign x=Banana{7} and y=x
I'm not sure I understand your last line.
I've been doing stuff like this for a while without DEF:
rem ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
rem '
rem ' All-purpose bits for various jobs.
rem '
rem ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
rem '
dim BitOp_All_Purpose_01 = t
dim BitOp0_Debounce_Reset = t
dim BitOp0_Fingernail_Soup = t
dim BitOp4_Toggle_Screen = t
dim BitOp5_B_Direction_X = t
dim BitOp6_B_Direction_Y = t
dim BitOp7_Missile0_Moving = t
Examples:
if BitOp0_Debounce_Reset{0} then blah blah blah
if BitOp0_Fingernail_Soup{0} then blah blah blah
if BitOp4_Toggle_Screen{4} then blah blah blah
if BitOp7_Missile0_Moving{7} then blah blah blah
So, unless the last line in your post means something else, if you want to have more than one meaningful alias in other places in a program, you need to use DIM. DEF is only useful for replacing one logical name with one unique string. Multiple uses of the same string is not allowed.
Edited by Random Terrain, Tue Aug 30, 2011 6:12 AM.