.. highlightlang:: us .. _clipboard_get_data: clipboard_get_data ================== .. index:: clipboard_get_data .. us.tag clipboard_get_data NOTREADYENGLISH clipboard New590 :ref:`clipboard_get_data` returns the clipboard data as a string. The sting can contain 0-characters. .. function:: data = clipboard_get_data(iFormat) data = clipboard_get_data(ssName) .. us.return **Return Value** *data* contains the clipboard data as a Unscript string. Two bytes from the clipboard are written into one Uniscript character. .. us.params **Parameters** .. uparam:: iFormat *iFormat* is the format index. .. uparam:: ssName *ssName* is the format name. .. us.example **Example** :: // The explorer writes the format CF_HDROP if files are copied into the // clipboard. // The format contains a header followed by the file names which are // separated by 0 characters. The end of the format contains two 0-characters. def test_hdrop() { s = clipboard_get_data("CF_HDROP"); nBytes = mem_len(s); if (nBytes == 0) { error("CF_HDROP not available"); } // The first interger is offset to the next file name. offset = mem_get(s, 1, "uint32", 1); v = mem_get(s, offset+1, "wchar_t", (nBytes-offset)/2); idx = find(v == 0); start = 1; nNames = len(idx)-1; sv = strempty(nNames, 1); for (i in 1:len(idx)-1) { sv[i] = strchar(v[start:idx[i]-1]) start = idx[i] + 1; } return sv; } .. us.history **History** .. list-table:: :header-rows: 1 * - Version - Description * - 5.9 - New .. seealso:: :ref:`overview-clipboard` :sub:`id-1931826`