Re: new allocate_string functions
- Posted by Robert Craig <rds at RapidEuphoria.com> Sep 13, 2004
- 416 views
Igor Kachan wrote: > > Hi, Dear EU users: > > There is the allocate_string() function > in the standard RDS machine.e library. > > Try please some variations on this theme: OK, it's not quite as readable, but you've convinced me:
global function allocate_string(sequence s) -- create a C-style null-terminated string in memory atom mem mem = machine_func(M_ALLOC, length(s) + 1) -- Thanks to Igor if mem then poke(mem, s) poke(mem+length(s), 0) -- Thanks to Aku end if return mem end function
Regards, Rob Craig Rapid Deployment Software http://www.RapidEuphoria.com