1.7General purpose

Generic language and type oriented functions.

Classes

Functions

PageDict

Creates a paged dictionary (which is internally represented as a B-Tree).

PageDict( pageSize )
pageSize size of pages expressed in maximum items.
ReturnA new dictionary.

The function returns a Falcon dictionary that can be handled exactly as a normal dictionary. The difference is only in the internal management of memory allocation and tree balance. Default Falcon dictionaries (the ones created with the "[=>]" operator) are internally represented as paired linear vectors of ordered entries. They are extremely efficient to store a relatively small set of data, whose size, and possibly key order, is known in advance. As this is exactly the condition under which source level dictionary are created, this way to store dictionary is the default in Falcon. The drawback is that if the data grows beyond a critical mass linear dictionary may become sluggishly slow and hang down the whole VM processing.

This function, which is actually a class factory function (this is the reason why its name begins in uppercase), returns an empty Falcon dictionary that is internally organized as a B-Tree structure. At a marginal cost in term of memory with respect to the mere storage of falcon items, which is used as spare and growth area, this structure offer high performances on medium to large amount of data to be ordered and searched. Empirical tests in Falcon language showed that this structure can scale up easily to several millions items.

In general, if a Falcon dictionary is meant to store large data, above five to ten thousands elements, or if the size of stored data is not known in advance, using this structure instead of the default Falcon dictionaries is highly advisable.

epoch

Returns the number of seconds since the "epoch" (1 Jan 1970).

epoch()
ReturnAn integer number of seconds.

seconds

Returns the number of seconds and milliseconds from day, activity or program start.

seconds()
ReturnThe number of seconds and fractions of seconds in a floating point value.

Actually, this function returns a floating point number which represents seconds and fraction of seconds elapse since a conventional time. This function is mainly meant to be used to take intervals of time inside the script, with a millisecond precision.

systemErrorDescription

Returns a system dependent message explaining an integer error code.

systemErrorDescription( errorCode )
errorCode A (possibly) numeric error code that some system function has returned.
ReturnA system-specific error description.

This function is meant to provide the users (and the developers) with a minimal support to get an hint on why some system function failed, without having to consult the system manual pages. The fsError field of the Error class can be fed directly inside this function.

Variables

args

Script arguments

A global variable holding an array that contains the strings passed as argument for the script. Embedders may change the convention, and pass any Falcon item as arguments; however, falcon command line and the other standard tools pass only an array of strings.

scriptName

Logical module name of current module

It's a global variable that is usually filled with the script name. It's the logical script name that the VM has assigned to this module, mainly used for debugging.

scriptPath

Complete path used to load the script

It's a global variable that is usually filled with the location from which the script has been loaded. It's semantic may vary among embedding applications, but it should usually receive the complete path to the main script, in Falcon file convention (forward slashes to separate directories), or the complete URI where applicable.

Made with http://www.falconpl.org