[comp.sys.mac.programmer] Help in writing CDEF

isbell@rice-chex.ai.mit.edu (Charles Isbell) (01/19/91)

Hi.  I'm posting this for a friend who doesn't have posting access
yet.  Please send any e-mail to him (gt4179a@hydra.gatech.edu) or post.
Also send any flames his way :-).  Thanks.

Bryan Godwin writes:
------------------------------------------------------------------------------

I am trying to write my own control definition function in Turbo Pascal.  
According to my references, I can insert my compiled function code in my 
resource file quite easily by using RMAKER.  My problem is generating the 
compiled function code.  I have attempted a program, consisting of only my 
function definition, of the form

program;
uses;

function;

begin
end.

but this doesn't seem to work.

Is there any way in Turbo Pascal to do this or am I going about this in
the wrong way?

Thanks
Bryan Godwin

Think about it till |    Banned because of his    | Don't just adopt opinions, 
the Brother returns |  blatant use of... reality  |      _develop_ them 
You can't always depend on people to do the right thing or the wrong thing,
          but you can always count on them to do the stupid thing

aep@world.std.com (Andrew E Page) (01/19/91)

bear in mind that a CDEF(as with an MDEF, WDEF etc) is a STAND ALONE
resource.  As such it will contain all the subfunctions (even though they
may be repeated in your main application) that it needs to function.  
The entry poiint to this will be your MAIN program ( I am a C lover)
which will have the approriate arguments.  The last argument is the routine
selector.  This will be used to determine which part of the code to use.

Check out IM I-329 for a more complete definition of a CDEF.

Andrew E. Page