Hello,
i want put a couple of nullterminated Strings into
a BANK. I need this for passing a bank variable to
a DLL.
Any Ideas ?
I have found PokeString and PeekString$ in the code
archive, but i have no success.
Here is my testcode :
; Bank - Routinen
bank1 = CreateBank(5000)
a$ = "Hello"
b$ = "World !"
c$ = "How are you ?"
mystr$ = a$ + Chr$(0) + b$ + Chr$(0) + c$ + Chr$(0)
PokeString(bank1, 0, mystr$)
ges$ = PeekString$(bank1, 0, ges$)
Print ges$
;location = Instr(ges$, Chr$(0), 3)
d$ = Input$("Press RETURN to end...")
FreeBank bank1
End
Function PokeString(bank,offset,s$)
PokeInt bank,offset,Len(s$)
For i = 1 To Len(s$)
PokeByte(bank,offset+i+3, Asc(Mid$(s$,i,1)))
Next
End Function
Function PeekString$(bank,offset,s$)
l = PeekInt(bank,offset)
s$ = ""
For i = 1 To l
s$ = s$ + Chr$(PeekByte(bank,offset+i+3))
Next
Return s$
End Function
i want put a couple of nullterminated Strings into
a BANK. I need this for passing a bank variable to
a DLL.
Any Ideas ?
I have found PokeString and PeekString$ in the code
archive, but i have no success.
Here is my testcode :
; Bank - Routinen
bank1 = CreateBank(5000)
a$ = "Hello"
b$ = "World !"
c$ = "How are you ?"
mystr$ = a$ + Chr$(0) + b$ + Chr$(0) + c$ + Chr$(0)
PokeString(bank1, 0, mystr$)
ges$ = PeekString$(bank1, 0, ges$)
Print ges$
;location = Instr(ges$, Chr$(0), 3)
d$ = Input$("Press RETURN to end...")
FreeBank bank1
End
Function PokeString(bank,offset,s$)
PokeInt bank,offset,Len(s$)
For i = 1 To Len(s$)
PokeByte(bank,offset+i+3, Asc(Mid$(s$,i,1)))
Next
End Function
Function PeekString$(bank,offset,s$)
l = PeekInt(bank,offset)
s$ = ""
For i = 1 To l
s$ = s$ + Chr$(PeekByte(bank,offset+i+3))
Next
Return s$
End Function