Forum Navigation
You need to log in to create posts and topics.

Clipboard/Memory??

Posted by: rush <rush@...>

I am using the following function to copy a board game to the
clipboard but it is chewing up memory. Can anyone spot an error?

LOCAL FN Clipboard
DIM rect;8
PICTURE ON (118,38)-(630,450) 'record a PICT
FOR x = 1 TO 80
LONG IF board(x) 3
PICTURE FIELD x,objs$(board(x))
END IF
NEXT x
PICTURE OFF, hndl& 'PICT for PICTURE
LONG IF hndl& > 0 'valid handle?
scrapHndl&= FN ZEROSCRAP 'delete contents
PICTlen& = FN GETHANDLESIZE(hndl&) 'size of pict?
osErr = FN HLOCK(hndl&) 'lock handle
LONG IF osErr = _noErr 'if no error
osErr = FN PUTSCRAP(PICTlen&, _"PICT", [hndl&]) :'put on clipbd
END IF
osErr = FN HUNLOCK(hndl&) 'unlock the handle
END IF
hndl& = 0
END FN

=====================================================
Martin Fitzgibbons

Email: ................ rush@w150.aone.net.au
Web Site .............. http://www.illawarra.net.au/rush