Symbol Address of an Array
Michael @ Afineol
Posts: 33
VAR BYTE arrSet[noparse][[/noparse]25] WORD RecordCounter 'This will track where to write the next record PUB Init Object(@RecordCounter, @arrSet) ' ..Additional Code Object2(@RecordCounter, @arrSet) ' ..Additional Code PUB Object(vPTR_Record, aSet) | Offset, T Repeat T From 1 to 3 Offset := WORD[noparse][[/noparse]vPTR_Record] BYTE[noparse][[/noparse]aSet + Offset] := 0 WORD[noparse][[/noparse]vPTR_Record]++ PUB Object2(vPTR_Record, aSet) | T Repeat T From 1 to 3 BYTE[noparse][[/noparse]aSet[noparse][[/noparse]WORD[noparse][[/noparse]vPTR_Record]] := 1 WORD[noparse][[/noparse]vPTR_Record]++
In SPIN I want to pass the Address of an Array and·the·Address of the Offset of the starting address of the Array into an Object. In the code above I have 2 examples. Which one will let met manipulate the data of the Array passed into the Object so when the Object is complete the data stays modified and the RecordCounter is incremented to the next available record.
Comments
is right after aSet, both access methods are equivalent (the second is slightly shorter). If you put it at the end you're in deep water [noparse]:)[/noparse]