clipboard

Manages the TRIMpl clipboard.

Available in:

Apps (win) Apps (char) Reportwriter RPC Standalone PL
X X X X X

Syntax

retval clipboard(command[,parm[,...]])
expr           retval
int            command
expr           parm

Description

Manages the TRIMpl clipboard. The clipboard is a memory area that can hold any datatype. The return value is determined by the command. Offsets are zero-based.
command specifies what clipboard operation to execute (see trim.h for cb_* values) and is one of:

  • cb_alloc,[size[,inc]] -- Allocate the clipboard with two optional parameters.The first parameter is the initial clipboard size and the second is the increment size. The defaults are initial size of 128,000 bytes and increment size of 32,000 bytes.

  • cb_free -- Frees the clipboard and its resources.

  • cb_length[,length] -- Returns the current length of the clipboard. If the length is given, sets the current length of the clipbaord and returns the new length.

  • cb_append[,data] -- Appends the data in the parm and returns the new length of the clipboard. The data is not converted.

  • cb_insert[,data[,offset]] -- Inserts the data at the given offset. The data is not converted. The default offset is 0. Returns the new length.

  • cb_delete[,offset[,length]] -- Deletes the data starting at the given offset. If the optional length is not given, then the clipboard is truncated at the offset. The default offset is 0 and the length is remainder of the clipboard. Returns the new length.

  • cb_extract[,offset[,length]] -- Returns the data starting at the given offset. If the optional length is not given, then all the data from the offset to the end is returned. The default offset is 0 and the length is remainder of the clipboard. The data is returned as a character datatype.

  • cb_file,filename[,write[,append]] -- Reads or writes the file (see file specification) . If write is false, then the file is read. If append is false, then the data is not appended to the file or clipboard. Returns the length of the clipboard.