MfuncAlloc()函数

Synopsis

Allocate a Pseudo-MIL function.

Format

MIL_ID MfuncAlloc(FunctionName, ParameterNumber)

char *FunctionName; Function name
long ParameterNumber; Number of parameters passed

Description

This function allows you to associate the current user-created function (that is, the function calling MfuncAlloc) with a MIL identifier and allocate it as a pseudo-MIL function. This function will then be considered as a standard MIL function, respecting all of MIL environment controls, such as tracing and error handling.

You must establish the existence of the pseudo-MIL function (with a call to MfuncAlloc), before calling any other function. You must also register each parameter of this pseudo-MIL function by calling the appropriate MfuncParam…() function (MfuncParamChar, MfuncParamDouble, MfuncParamId, MfuncParamLong, MfuncParamPointer, MfuncParamShort, MfuncParamString). Once this has been done, you must signal the actual start of the pseudo-MIL function by calling MfuncStart.

Upon completion, you must signal the end of the pseudo-MIL function by calling MfuncFreeAndEnd.

The FunctionName parameter is a null terminated string specifying the name of the current user-created function.

The ParameterNumber parameter is the number of parameters passed to the current user-created function.

Returned value

The returned value is a MIL identifier for the function; M_NULL on error.

See also

MfuncStart, MfuncFreeAndEnd, MfuncParamChar, MfuncParamDouble, MfuncParamId, MfuncParamLong, MfuncParamPointer, MfuncParamShort, MfuncParamString