CopyMemoryString()

Syntax

Result = CopyMemoryString(*String [, @*DestinationMemoryID])
Description
Copy the string from the specified address to the destination memory address if specified, or at the end of the previous buffer if omitted.

Parameters

*String The address of the string to copy. The string must be terminated with a null-character. The string is expected to be in the PB string format.
@*DestinationMemoryID (optional) The pointer to a variable holding the address with the destination buffer. After the string has been copied, the variable *DestinationMemoryID will point to the null-character at the end of the copied string, so a further call to this function will append the new string to the previous one.

If this parameter is omitted, the address from the previous call is used.

Return value

Returns the value of *DestinationMemoryID after the string was copied.

Example

  *Buffer = AllocateMemory(1000)
  *Pointer = *Buffer
  CopyMemoryString("Hello", @*Pointer)
  CopyMemoryString(" World")  ; This one will be put just after "Hello"
  *Pointer-2                  ; Come back from 2 characters (on the 'l' of 'World')
  CopyMemoryString("LD")      ; Finally the last two letters will be uppercase
  Debug PeekS(*Buffer)

See Also

CopyMemory(), PeekS(), PokeS()

Supported OS

All

<- CopyMemory() - Memory Index - FillMemory() ->