CStyle Byte Ptr String -> BMX String

BlitzMax Forums/BlitzMax Programming/CStyle Byte Ptr String -> BMX String

Pantheon(Posted 2006) [#1]
Hi,

This could sound like a stupid question but can anyone tell me how to convert a CStyle String (Null term Byte Ptr) into a BMX string. Surely there is a more efficient way then parsing every char until ~0 (null term) is found. If there was a way of quickly finding the null char then a mem copy could put it directly into a BMX string of the same length.

This sounds so neccesary that it surely has been solved.

Sorry if this has been posted before, im aware that that would be irritating.
Thanks.


Dreamora(Posted 2006) [#2]
String.FromCString:String(cstring:Byte Ptr) when I'm not totally wrong. (there is a fromWString as well for unicode strings)


Pantheon(Posted 2006) [#3]
Cool, thanks.
I never seem to be able to find these commands in the docs, I must just be blind or ignorant.
Thanks anyway, that realy helps.


Yan(Posted 2006) [#4]
'Language>Strings', shows you all the methods and function of the String object.


Pantheon(Posted 2006) [#5]
...and there it is. Sorry about that, I realy should have looked harder. Thanks for the help though.