[futurebasic] Re: Re: EFtoTEXT.rsrc

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : February 2001 : Group Archive : Group : All Groups

From: Robert Covington <artlythere@...>
Date: Sun, 18 Feb 2001 09:25:43 -0400
>I'm sitting here studying the structure of Robert P.'s styled edit
>field to resource demo. Could someone please explain what FN
>HANDTOHAND does?
>
>Looking at the end of this snippet, I'm guessing that somehow it
>converts textHndl from a handle to the TE record to a handle for
>resource use.


Ken,

From Inside Mac, HandToHand Toolbox call at <
http://developer.apple.com/techpubs/mac/Memory/Memory-106.html >

HandToHand

       Use the HandToHand function to copy all of the data from one
relocatable block to a new relocatable block.

       FUNCTION HandToHand (VAR theHndl: Handle): OSErr;

       theHndl
              On entry, a handle to the relocatable block whose data is to
be copied. On exit, a handle to a new relocatable block whose
              data duplicates that of
              the original.

       DESCRIPTION

       The HandToHand function attempts to copy the information in the
relocatable block to which theHndl is a handle; if successful,
       HandToHand returns a handle to the new relocatable block in theHndl.
The new relocatable block is created in the same heap zone
       as the original block (which might not be the current heap zone).

       Because HandToHand replaces its input parameter with the new handle,
you should retain the original value of the input parameter
       somewhere else, or you won't be able to access it. Here is an example:

       VAR
          original, copy: Handle;
          myErr: OSErr;
       ...
          copy := original;          {both handles access same block}
          myErr := HandToHand(copy); {copy now points to copy of block}


Then there is the HandAndHand call..

From same tech pub area:

HandAndHand

       Use the HandAndHand function to concatenate two relocatable blocks.


Hope that clarifies something?

Robert Covington