Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Cyberdog Programmer's Kit / Part 3 - Cyberdog Reference
Chapter 7 - Classes and Methods / ParameterSet


PutParameter

Adds the specified parameter to this parameter set.

void PutParameter (in ParameterKey key, 
in void* param, 
in ParamDestructorUPP destructor);
key
The name of the parameter to add.
param
A pointer to the parameter.
destructor
A pointer to a programmer-defined destructor for the parameter.
DISCUSSION
You call this method to add a parameter and its destructor to a ParameterSet object. If the parameter set already contains a parameter of the same name, the method throws the kCDErrParamAlreadyExists exception.

The following type is used for parameter destructor functions. A parameter destructor takes two parameters: an environment pointer and a pointer of type void*; the function returns no value.

typedef void (* ParamDestructorProc)(Environment* ev,
void* param);
The MyParamDestructor programmer-defined function (page 194) illustrates the form of a parameter destructor.

If you do not specify a destructor function for a parameter in a parameter set, the parameter is not destroyed when the parameter set is disposed of.

SEE ALSO
The ParameterKey type (page 171).
The ExtractParameter method (page 393).
The GetParameter method (page 396).
The RemoveParameter method (page 398).


Previous Book Contents Book Index Next

© Apple Computer, Inc.
13 JUL 1996