This can handle any size text> About the 64k buffer:
> Personally, i have never hit that limit.
One such example: using the GetClipboardText() command will CRASH
your app if the clipboard holds more than 64K of data, essentially making
this command quite useless. That's why I'd like to see unlimited strings.
(In the meantime, I'm using a custom GetClipboardText command that
only gets the first 64K of text. Not a great solution at all, but necessary).

Code: Select all
OpenClipboard_(#NULL)
If IsClipboardFormatAvailable_(#CF_TEXT) <> 0
hStrPtr.l = GetClipboardData_(#CF_TEXT)
If hStrPtr <> 0
;Only display the first 30 characters of the Clipboard text!
Debug PeekS(hStrPtr, 30) ; This command is subject to the >64k limit.
SetWindowText_(GadgetID(#StringGadget), hStrPtr) ; Fill a gadget with the text.
EndIf
EndIf
CloseClipboard_()