[futurebasic] Re: Clipboard/Memory??

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

From: Martin Fitzgibbons <rush@...>
Date: Fri, 12 Dec 1997 00:01:24 +1100
The discussion on Handles and memory has been very helpful, I decided to
try 2 of the suggestions. Unfortuneately David's suggestion of making
the handle purgeable and letting the memory manager handle it doesn't
seem to work. Each time I call the Clipboard Fn I seem to loose more

However if I use DEF DISPOSEH(hndl&) it clears the handle. Why???

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 of
    PICTlen&  = FN GETHANDLESIZE(hndl&)           'size of pict?
    osErr     = FN HLOCK(hndl&)                   'lock handle
    LONG IF osErr = _noErr                        'if no error then...
      osErr = FN PUTSCRAP(PICTlen&, _"PICT", [hndl&]) :'put on clipbd
    END IF
    osErr = FN HUNLOCK(hndl&)                     'unlock the handle
  hState = FN HGETSTATE(hndl&)                    'Davids offering
  err = FN HPURGE(hndl&)
  err = FN HSETSTATE(hndl&,hState)
  'DEF DISPOSEH(hndl&)                            'Alternate disposal

Martin Fitzgibbons
Rush Software

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