CallFunctionFast()

Syntax

Result = CallFunctionFast(*FunctionPointer [,Parameter1 [, Parameter2...]])
Description
Calls a function directly, using its address. This pointer may be found using the GetFunction(), GetFunctionEntry() or LibraryFunctionAddress() functions. The use of this function is the fastest method with which to call library functions, especially when the results of a call to: GetFunction() or LibraryFunctionAddress() have been stored. This is due to the fact that this function is not required to search for the name of the library function.

This function also gives the programmer the ability to call PureBasic procedures from within the applications code. The address of a PureBasic procedure may be obtained by using the '@'symbol in front of the procedure name, such as "@myprocedure()".

Any number of parameters may be specified, but the number of these specified parameters, must be identical to the number of parameters required by the function. For example, if a function requires 2 parameters, then 2 parameters must be passed, even if these 2 values are null.
Note: Currently the maximum number of parameters is 20.

Parameters

*FunctionPointer - The address in memory of the function to be called.

Parameter1, Parameter2, ... - The parameters for the function to be called. The number of these parameters, must be identical to the number of parameters required by the function, as described in the developer documentation for that library.

Return value

Result - The result of the function that has been called.

Note: This function is not very flexible and does not handle string/float/double/quad parameters or string/float/double/quad returns. The use of: prototypes is now strongly recommended.

Supported OS

All

<- CallFunction() - Library Index - CloseLibrary() ->