if the null character is an issue i think you may be ok. the following does not print "null".
or, you can write directly from the string without converting to a pointer first:
Framework BRL.Basic Local teststr:String="different" DebugLog(teststr) Local test:TBank=New TBank ' create a stream to access the bank Local tstream:TBankStream=TBankStream.create(test) Local testptr:Byte Ptr=teststr.ToCString() For i=0 To teststr.length-1 If (testptr[i]=0) DebugLog("null") EndIf DebugLog(Chr(testptr[i])) ' write the char to the bank tstream.writeBytes(Chr(testptr[i]),1) Next teststr=String.FromCString(test.Buf()) DebugLog(teststr)
or, you can write directly from the string without converting to a pointer first:
Framework BRL.Basic Local teststr:String="different" DebugLog(teststr) Local test:TBank=New TBank ' create a stream to access the bank Local tstream:TBankStream=TBankStream.create(test) For i=0 To teststr.length-1 DebugLog(Chr(teststr[i])) ' write the char to the bank tstream.writeBytes(Chr(teststr[i]),1) Next teststr=String.FromCString(test.Buf()) DebugLog(teststr)