Array members as alias? (BS2 OEM)
Can a member of an array be assigned an alias name?·
Apparently not.
I have·this code:
I2C_Data VAR Byte(4)
and like to have these alliases
TSL2561_Address VAR· I2C_Data····· ' slave address
TSL2561_Command VAR· I2C_Data····· ' command
TSL2561_Data··· VAR· I2C_Data····· ' data = $03
Editor comes up with an error on
TSL2561_Address VAR· I2C_Data(0)
and
TSL2561_Address VAR· I2C_Data[noparse][[/noparse]0]
··
Is there an alternative to accomplish this?
I am currently passing the variables to a subroutine using LOOKUP to get the array index and like to try eliminating the LOOKUP.
Just for fun so far.
Thanks ·for reading.
Cheers
Apparently not.
I have·this code:
I2C_Data VAR Byte(4)
and like to have these alliases
TSL2561_Address VAR· I2C_Data····· ' slave address
TSL2561_Command VAR· I2C_Data····· ' command
TSL2561_Data··· VAR· I2C_Data····· ' data = $03
Editor comes up with an error on
TSL2561_Address VAR· I2C_Data(0)
and
TSL2561_Address VAR· I2C_Data[noparse][[/noparse]0]
··
Is there an alternative to accomplish this?
I am currently passing the variables to a subroutine using LOOKUP to get the array index and like to try eliminating the LOOKUP.
Just for fun so far.
Thanks ·for reading.
Cheers
Comments
i VAR Nib ' counter someVar VAR Byte ' named var AND element "0" of "implied" array someVar someVar1 VAR Byte ' ditto, but this element 1 someVar2 VAR Byte someVar3 VAR Byte ' so now you have 4 variables that ARE ALSO a 4 element array: someVar(x) someVar = 1 someVar1 = 10 someVar2 = 100 someVar3 = 255 DEBUG CLS FOR i = 0 TO 3 DEBUG "someVar(", DEC1 i,") = ", DEC3 someVar(i), CR NEXT END
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php