Futurebasic/Language/Reference/runtime

From Wikibooks, open books for an open world
Jump to navigation Jump to search

Syntax[edit | edit source]

RUNTIME

END RUNTIME

Description[edit | edit source]

The FB compiler has been created in such a way that it expects and calls upon specific functions located in the header folder. As an example, the statement WINDOW CLOSE wNum is routed to a runtime function named RUNTIME FBWindowClose(wNum&). A RUNTIME function behaves much like a local function, but the "RUNTIME" name indicates to FB that the function is part of the language. You may not add new syntax to FB by creating new RUNTIME functions. Only the compiler can make these calls. But you can modify these pieces of code as you would any source code. When all of the necessary headers have been compiled and FB is ready to begin examining your source code, the END RUNTIME statement tells FB that it no longer needs to track and record RUNTIME functions.

As you examine the RUNTIME functions, you may notice that only long integer parameters are used. This serves three purposes:

Long integers can be passed faster than any other type of parameter RUNTIME functions know in advance what type of parameter is expected. For instance, a RUNTIME function might expect a string pointer, but never a string. The use of long integers insures that variables will fall on long integer boundaries which greatly speeds the execution of PPC code.