RosettaCodeData/Task/Pointers-and-references/PureBasic/pointers-and-references-8.b...

21 lines
523 B
Plaintext

; Getting the address of a lable in the code
text$="'Lab' is at address "+Str(?lab)
MessageRequester("Info",text$)
; Using lables to calculate size
text$="Size of the datasetion is "+Str(?lab2-?lab)+" bytes."
MessageRequester("Info",text$)
; Using above to copy specific datas
Define individes=(?lab2-?lab1)/SizeOf(Integer)
Dim Stuff(individes-1) ; As PureBasic uses 0-based arrays
CopyMemory(?lab1,@Stuff(),?lab2-?lab1)
DataSection
lab:
Data.s "Foo", "Fuu"
lab1:
Data.i 3,1,4,5,9,2,1,6
lab2:
EndDataSection