String to Buffer

BlitzMax Forums/BlitzMax Programming/String to Buffer

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

here ya go. think this is what you want :)


Framework BRL.Basic

Local test:TBank=New TBank
Local teststr:String="testing"

' create a stream to access the bank
Local tstream:TBankStream=TBankStream.create(test)
' write the string to the bank
tstream.writeBytes(teststr.ToCString(),teststr.length)

' make the string different to test
teststr="different"
DebugLog(teststr)

' get a string back out of the bank
teststr=String.FromCString(test.Buf())
DebugLog(teststr)