Hi Primo,
perfectly valid, but this explicit length check is more safe:
Uses "StringBuilder", "Console"
Dim sb As New StringBuilder
sb.Add("Ciao world")
sb.Add("Ciao world")
Dim s As String * 4 At sb.DataPtr
PrintL s
printl
Long pointer
pointer = sb.DataPtr
String st
long i
For i=1 To sb.Length
st = Peek$(pointer, i)
PrintL st
Next
WaitKey
With this in mind, it is natural that you can reach the string inside like:
Uses "StringBuilder", "Console"
Dim sb As New StringBuilder
sb.Add("Ciao world")
sb.Add("Ciao world")
Dim s As String * sb.Length At sb.DataPtr
PrintL s
WaitKey
Petr
Bookmarks