Use of # to "pass" a value and/or convert hex????
ElectricAye
Posts: 4,561
Hi all,
I'm looking at SpinOneWire-test.spin from the Object Exchange (Thank you Micah Dowty!) and I'm baffled by the use of an operator(?) in the program, an operator that looks like #.
An object nicknamed ow is called up, and to that object is "passed" a value that is actually named in ow's list of constants.
The call looks like this
ow.writeByte(ow#MATCH_ROM)
In ow's own list of constants, we see this:
MATCH_ROM = $55
I'm guessing the # simply grabs the value of the constant MATCH_ROM from the ow program and uses it inside of its own ow program. But is # also converting the hex $55 to bits first or inserting the raw hex value... or what? I can't find documentation on # anywhere. It's not an operator listed in the manual, nor in Spin's assembly code.
What's # called and does anybody know where it's documented?
thanks,
Mark
I'm looking at SpinOneWire-test.spin from the Object Exchange (Thank you Micah Dowty!) and I'm baffled by the use of an operator(?) in the program, an operator that looks like #.
An object nicknamed ow is called up, and to that object is "passed" a value that is actually named in ow's list of constants.
The call looks like this
ow.writeByte(ow#MATCH_ROM)
In ow's own list of constants, we see this:
MATCH_ROM = $55
I'm guessing the # simply grabs the value of the constant MATCH_ROM from the ow program and uses it inside of its own ow program. But is # also converting the hex $55 to bits first or inserting the raw hex value... or what? I can't find documentation on # anywhere. It's not an operator listed in the manual, nor in Spin's assembly code.
What's # called and does anybody know where it's documented?
thanks,
Mark
Comments
This is briefly documented on page 199 of the Propeller Manual.
cheers,
Mark