[futurebasic] Clipboard/Memory??

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : December 1997 : Group Archive : Group : All Groups

From: Martin Fitzgibbons <rush@...>
Date: Sat, 06 Dec 1997 23:20:09 +1100
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@...
Web Site .............. http://www.illawarra.net.au/rush