# clipb2var

Copies the text data of clipboard.

    clipb2var <strvar> [<offset>]

## Remarks

Copies the text data in clipboard to <strvar>.
If clipboad content is too long, copied data was truncated. (cf. maximum length of a string) If offset is specified, copied string starts offset*255-1 bytes.

The "clipb2var" command returns one of the following values in the system variable "result":

Value | Meaning
--- | ---
0 | Could not open the clipboard. Or the clipboard content was not a text data. Or the offset value was invalid.
1 | Copying to <strvar> is successful.
2 | Copied string was truncated. If you want to read a truncated data, increment a offset value and execute a clipb2var comannd again.
3 | Could not allocate a memory to copy a clipboard content.

## Example

    clipb2var data
    messagebox data 'clipboard data'

    ; read a clipboard content and write it to a file.
    fileopen fp 'clipboard.txt' 0
    if result <> 0 end

    offset = 0
    do
        clipb2var buff offset
        if result > 0 filewrite fp buff
        offset = offset + 1
    loop while result = 2

    fileclose fp