FuncFib

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

Example user-defined worksheet function that computes the Nth Fibonacci number. When GENERIC.xll is loaded, it registers this function so that it can be called from the worksheet.

LPXLOPER12 WINAPI FuncFib (LPXLOPER12 pxN);

Parameters

pxN (LPXLOPER12)

The value of N for which the Nth Fibonacci number is required.

Property Value/Return Value

(xltypeNum LPXLOPER12 if successful or xltypeErr otherwise)

The Nth Fibonacci number.

Remarks

The function uses a static variable defined within the function block as the return value XLOPER12. This is not thread safe, and so this function, and any worksheet function that uses this strategy for returning XLOPERs or XLOPER12s, should not be registered as thread safe in Microsoft Office Excel 2007.

Example

See \SAMPLES\GENERIC\GENERIC.C for the source code for this function.

See Also

Concepts

Functions in the Generic DLL