Byte Ptr To String

BlitzMax Forums/BlitzMax Beginners Area/Byte Ptr To String

Eric(Posted 2007) [#1]
Is there a way to convert from a Byte Prt a string?


grable(Posted 2007) [#2]
' from null terminated strings
Local s:String = String.FromCString(p)

' from an arbitrary length
Local s:String = String.FromBytes(p, 10)



Dreamora(Posted 2007) [#3]
or String.FromWString(p) if it was a UTF-16 one


ImaginaryHuman(Posted 2007) [#4]
Local s:String=String(p)

or if it won't let you do that:

Local s:String=String(Int(p))


Eric(Posted 2007) [#5]
Thanks all.. but for some reason I'm not getting expected results. Back to the drawing board.


Brucey(Posted 2007) [#6]
What exactly are you trying to do?

The assumption is you have a byte ptr that is pointing to a character string.


Eric(Posted 2007) [#7]
Yep that is that is what I am trying to do. OK.. I'm playing with this physics wrapper. http://rubux.swargo.com/ And there is a Function that returns a byte Prt.. I know it's a String. I posted my question over on the authors site. I'll see what he says.