Manipulating Stringarraypointer
Posted: Mon Apr 14, 2008 7:11 am
I have written a resident starter program which should keep as less memory as possible - actually it uses around 5MB (inclusive virtual memory), some of it because of graphics and co.
But one part is also because I read the program names, descriptions, parameters, file pathes from datas - so it is kept two times in the memory.
At that moment I thought it could be useful to be able to set the pointer of string array members to a specific address manually but then one additional keyword would be needed to get the address of each entry of a data section
I think, I wrote everything a little bit too complicate, maybe I should do a pseudo code as well...
But one part is also because I read the program names, descriptions, parameters, file pathes from datas - so it is kept two times in the memory.
At that moment I thought it could be useful to be able to set the pointer of string array members to a specific address manually but then one additional keyword would be needed to get the address of each entry of a data section
I think, I wrote everything a little bit too complicate, maybe I should do a pseudo code as well...
#Max=1000
Global Dim constants.s(#Max)
Global Dim a.s(#Max)
Global Dim b.s(#Max)
dummy.s
Restore
For i=1 To 6
; Set address of the string to the actual read pointer...
@constants(i)=#PB_Compiler_ReadAddress
Read Dummy;
Read a(i)
Read b(i)
Next
DataSection
Data.s "<<start 1>> very long text <<end>>","a","b"
Data.s "<<start 2>> very long text <<end>>","x","y"
Data.s "<<start :>> very long text <<end>>",":",":"
Data.s "<<start 1000>> very long text <<end>>","z","z"
EndDataSection