RosettaCodeData/Task/Pointers-and-references/PureBasic/pointers-and-references-8.purebasic
Ingy döt Net b83f433714 tasks a-s
2013-04-10 23:57:08 -07:00

20 lines
523 B
Text

; 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