More "RESTORE" functionality
- DoubleDutch
- Addict
- Posts: 3220
- Joined: Thu Aug 07, 2003 7:01 pm
- Location: United Kingdom
- Contact:
More "RESTORE" functionality
The ability to set the "restore" point using a variable would be great, also the ability to read the current data read position would be good too.
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
https://reportcomplete.com <- School end of term reports system
Re: More "RESTORE" functionality
> The ability to set the "restore" point using a variable would be great
Agreed. I tried using pointers to do this, but was unsuccessful.
Also, it would be good if the Read command could have more than one
parameter per line... for example, the following code gives an error:
Agreed. I tried using pointers to do this, but was unsuccessful.
Also, it would be good if the Read command could have more than one
parameter per line... for example, the following code gives an error:
Code: Select all
Read a$,b$,c$ ; Won't work, need 3 x Read lines instead. :(
Debug a$+" "+b$+" "+c$
DataSection
Data.s "Hello","There","Mate"
EndDataSection
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
"PureBasic won't be object oriented, period" - Fred.
you could set a var to the address of the label in the datasection and then
for long type data you can even do this
Code: Select all
Procedure LabelTest(LabelAdress.l)
! MOV eax,[esp]
! MOV dword [PB_DataPointer],eax
EndProcedure
lb.l=?label2
LabelTest(lb)
Read text.s
Debug text.s
End
DataSection
label1:
Data.s "Text from Label 1"
label2:
Data.s "Text from Label 2"
label3:
Data.s "Text from Label 3"
EndDataSection
Code: Select all
Procedure LabelTest(LabelAdress.l,offset.l)
! MOV eax,[esp]
! add eax,[esp+4]
! MOV dword [PB_DataPointer],eax
EndProcedure
lb.l=?label2
LabelTest(lb,16)
Read l
Debug l
End
DataSection
label1:
Data.s "Text from Label 1"
label2:
Data.l 1,2,3,4,5
label3:
Data.s "Text from Label 3"
EndDataSection
- DoubleDutch
- Addict
- Posts: 3220
- Joined: Thu Aug 07, 2003 7:01 pm
- Location: United Kingdom
- Contact:
That should work perfectly - thanks 
I will just add another function to read the current address of PB_DataPointer into a variable.
Fred: Will you add this kind of functionality into purebasic, they would be good as native commands.
-Anthony

I will just add another function to read the current address of PB_DataPointer into a variable.
Fred: Will you add this kind of functionality into purebasic, they would be good as native commands.
-Anthony
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
https://reportcomplete.com <- School end of term reports system