thanks
Code: Select all
mem = AllocateMemory(26)
PokeS(mem, "Hi" + Chr(0) + " Bye")
Debug PeekS(mem) ; Print HiCode: Select all
mem = AllocateMemory(26)
PokeS(mem, "Hi" + Chr(0) + " Bye")
Debug PeekS(mem) ; Print Hi
Code: Select all
mem = AllocateMemory(26)
PokeS(mem, "Hi" + Chr(0) + " Bye")
For poi = mem To mem + 25
ch = PeekC( poi )
Debug Str(ch) + " : " + Chr(ch)
NextCode: Select all
mem = AllocateMemory(26)
PokeS(mem, "Hi" + Chr(0) + " Bye")
PokeS(mem+3, " BYE")
For poi = mem To mem + 25
ch = PeekC( poi )
Debug Str(ch) + " : " + Chr(ch)
NextCode: Select all
a.s = "Hi" + Chr(0) + " Bye"
Debug Chr(PeekC(@a))
Debug Chr(PeekC(@a+1))
Debug Chr(PeekC(@a+2))
Debug Chr(PeekC(@a+3))
Debug Chr(PeekC(@a+4))
Debug Chr(PeekC(@a+5))
Debug Chr(PeekC(@a+6))
Code: Select all
a.s = "Hi Bye"
Debug Chr(PeekC(@a))
Debug Chr(PeekC(@a+1))
Debug Chr(PeekC(@a+2))
Debug Chr(PeekC(@a+3))
Debug Chr(PeekC(@a+4))
Debug Chr(PeekC(@a+5))
Debug Chr(PeekC(@a+6))
That makes sense, since "Hi" + Chr(0) + " Bye" would be invalid for any string operations. They would have to do something unusual (see my pokeS above) to even allocate it.Peyman wrote:thanks Gaman and rsts good idea so we just can peek char by char to end of memory because we cant find end of string but i think this problem comes from strings value in purebasic not PokeS and PeekS, i think purebasic truncate strings till a null char then allocate it :
