FunctionNotFoundException

From Xojo Documentation
Jump to: navigation, search

Class (inherits from RuntimeException)

A function declared using the Declare statement's “Soft” keyword could not be loaded.


Notes

A FunctionNotFoundException is raised when a Soft Declare statement such as this:

Soft Declare Function getpid Lib "libc" () as Integer


fails to find the specified function or library and it cannot be loaded. If a “hard” Declare fails to load the function, the application will not run at all.

To determine whether the function can be loaded without actually using the Soft Declare, use the System module’s IsFunctionAvailable method. It returns a Boolean indicating whether the function can be loaded on the user’s machine.

Example

The following example adds a RuntimeException handler to the above example.

Soft Declare Function getpid Lib "libc" () as Integer

exception err as FunctionNotFoundException
MsgBox err.message+" Error No.: "+str (err.ErrorNumber)

See Also

Declare statement, RuntimeException class, Exception, Try statements; System module.

Personal tools
Namespaces

Variants
Actions
Main
Content
Starting Out
Dig Deeper
More Help
Toolbox
About