GET CLIPBOARD

4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next

version 6.0


GET CLIPBOARD (dataType; data)

ParameterTypeDescription
dataTypeString4-character string data type
dataBLOBRequested data extracted from the clipboard

Description

The GET CLIPBOARD command returns into the BLOB field or into the variable data the data present in the Clipboard and whose type you pass in dataType.

WARNING: The value you pass in dataType is case sensitive, i.e., "abcd" is not equal to "ABCD."

If the data is correctly extracted from the clipboard, the command sets the OK variable to 1. If the Clipboard is empty or does not contains any data of the specified type, the command returns an empty BLOB, sets the OK variable to 0 and generates an error -102. If there is not enough memory to extract the data from the clipboard,the command sets the OK variable to 0 and generates an error -108.

Example

The following object methods for two buttons copy from and paste data to the array asOptions (pop-up menu, drop-downlist,...) located in a form:

      ` bCopyasOptions object method
   If (Size of array(asOptions)>0)  ` Is there something to copy?
      VARIABLE TO BLOB (asOptions;$vxClipData)  ` Accumulate the array elements in a BLOB
      CLEAR CLIPBOARD  ` Empty the clipboard
      APPEND TO CLIPBOARD ("artx";asOptions)  ` Note the data type arbitrarily chosen
   End if

      ` bPasteasOptions object method
   If (Test clipboard ("artx")>0)  ` Is there some "artx" data in the clipboard?
      GET CLIPBOARD ("artx";$vxClipData)  ` Extract the data from the clipboard
      BLOB TO VARIABLE ($vxClipData;asOptions)  ` Populate the array with the BLOB data
      asOptions:=0  ` Reset the selected element for the array
   End if
      

See Also

APPEND TO CLIPBOARD, GET PICTURE FROM CLIPBOARD, Get text from clipboard.

System Variables

If the data is correctly extracted, OK is set to 1; otherwise OK is set to 0 and an error is generated.

Error Handling

If there is not enough memory to extract the data, an error -108 is generated.

If there is no data of the requested type in the clipboard, an error -102 is generated.


4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next