String to byte ptr ?

BlitzMax Forums/BlitzMax Programming/String to byte ptr ?

Hi,

Ok, shouldn't really be talking about this here but a heads up wont hurt...

The next release of Max will no longer automatically convert strings to Byte Ptr's - you need to explicitly call ToCString...

Local p:Byte Ptr=mystring.ToCString()
...do stuff with p...
MemFree p

...Note the MemFree after you've finished with the Byte Ptr.

The reason for this is that with automatic GC you can't predict when such 'automatic cstrings' may be reclaimed, so I decided to take them out of the GC loop altogether.