From Xojo Documentation

You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!

Class (inherits from RuntimeException)

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

ErrorNumber Message
Stack StackFrames


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.

Sample Code

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.