[futurebasic] Re: [FB] Clipboard ->iMac Freeze

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : November 1999 : Group Archive : Group : All Groups

From: Joe Lewis Wilkins <PepeToo@...>
Date: Wed, 10 Nov 1999 06:49:03 -0800
M Fitzgibbons wrote:

> The following code works ok on old macs but freezes on an iMac.
>
> Any suggestions?
>
> Martin
>
> LOCAL FN Clipboard
>   DIM rect.8
>   LONG IF newbmp = 1 AND clipsol = 0
>     CALL SETRECT(rect,33,83,434,404)
>   XELSE
>     CALL SETRECT(rect,33 + cx,83 + cy,434 - cx,404 - cy)
>   END IF
>   hndl& = USR GETPICT(rect)
>   LONG IF hndl& > 0                               'valid handle?
>     scrapHndl&= FN ZEROSCRAP                      'delete contents of
> scrap
>     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
>   END IF
>   LONG IF clipsol = 0
>     a$ = "Crossword copied to Clipboard."
>   XELSE
>     a$ = "Solution copied to Clipboard."
>   END IF
>   FN message(a$)
> END FN

Hi Fitz,

First I'd DIM everything, particularly the hndls. Then I'd check to see I had
values for everything; like are newBmp and clipSol Globals, or what? If not,
you have some missing parameters/arguments to the FN. I can't imagine this FN
working on any Mac/System as is - at least as you represent it here.

And what is the colon doing in:

osErr = FN PUTSCRAP(PICTlen&, _"PICT", [hndl&]) :'put on clipbd

I hate to be so critical, but this method of coding is an accident just
waiting to happen. AND, if I didn't say something, the list MOM would/will -
I'd bet on it!

Have a good one.  *-}

Joe Wilkins