Libraries

[ Back ]

A library is a precompiled set of sub routines. You create a library by adding the L parameter to the compiler (ex: naalaa6 my_program L) or by pressing F8 in the NaaLaa Editor. This generates a file with the ending ".lib".

Libraries may contain global variables and constants. You can even add code outside of the sub routines. All such library code is executed at the very beginning of the program that imports the library (no matter where you place the import command presented below). Constants declared in a library are visible to other programs.

Sub routines

procedure import filename$


procedure import filename$

This compiler directive imports library lib_filename. All sub routines and constants present in the library can then be accessed from the program. Ex:

import "MyLib.lib"

If the compiler can't find a library that you're trying to import, it will look in its own library folder (usually C:\Program Files (x86)\NaaLaa Creator\NaaLaa 6\bin\libs). This means that you don't need to copy the standard libraries to the same folder as your own program.


[ Back ]