poke_string

Definition: atom addr = poke_string(atom buffaddr, integer buffsize, sequence s)
Description: Stores a C-style null-terminated ANSI string in memory

buffaddr: the RAM address to store the string at.
buffsize: the number of bytes available, starting from buffaddr.
s: the string to store at address buffaddr.

Returns an atom. If this is zero, then nothing was stored, otherwise it is the address of the terminating zero after the stored string.
Comments: This does not allocate RAM. You must supply the preallocated area (or use allocate_string instead).
This can only be used on ANSI strings. It cannot be used for double-byte strings.
If s is not a string, or longer than the available space, nothing is stored and a zero is returned.
Example:
atom title = allocate(20)
if poke_string(title, 20, "The Wizard of Oz") then
    -- successful
else
    -- failed
end if
...
free(title)
See Also: allocate, allocate_string, allocate_wstring, free