Rik's Treehouse > Babbling in Binary > My Software > Orphanware > R2DToo > R2DToo Help > For the Programmer > getParamRef

getParamRef

Declaration
Parameters
Return Value
Remarks
Revisions
Example
See Also

Declaration

pParam __stdcall getParamRef(
    char* name    // parameter name
);
Top of page

Parameters

name
Name of a valid parameter.
Top of page

Return Value

A pointer (reference) to the parameter name or NULL if not found. Top of page

Remarks

This function is available through the API. Use it to retrieve a pointer shortcut to a parameter. Once you have the pointer you can access (read or write) the parameter directly through the shortcut without needing any more function calls.

If a parameter named name can't be found, the function returns NULL.

Top of page

Revisions

API v1.5
  • new!
Top of page

Example

pParam shortcut; //--------------------------------------------------------------------------- void __stdcall onSimCreate(void) { shortcut = getParamRef("Some global quantity"); } //--------------------------------------------------------------------------- void __stdcall onTick(double &time) { if (*shortcut > 1) { // if parameter "Some global quantity" > 1 forEachAgent(handleType1); } else { forEachAgent(handleType2); } } //---------------------------------------------------------------------------
Top of page

See Also

initParams, assignParam, getParamVal.
Top of page
[Rik's Office Hours] [Contact Rik]
Last updated: Fri Apr 30 2004, 1:39pm