Loads a userlib's declarations (a .decls file), such as the runtime the program uses
Keywords
Parameters & Returns
Parameters
This function takes no parameters.
Returns
Void
Quick Summary
Loads a userlib's declarations (a .decls file), such as the runtime the program uses
Technical Exegesis...
Loads a userlib's declarations. Syntax is Import "name.decls", which reads userlibs/name.decls: the functions it lists can then be called from the program, and the DLL it names is loaded when the program starts (and copied beside it when it is built). Import is how a program picks its runtime, so every program imports one, near the top:
BBRuntime64.decls - Desktop (DX12)
BBRuntimeVulkan.decls - Desktop (Vulkan)
BBRuntimeWeb.decls - Web (WebGPU)
BBRuntimeWebGL2.decls - Web (WebGL2)
Loads a userlib's declarations. Syntax is Import "name.decls", which reads userlibs/name.decls: the functions it lists can then be called from the program, and the DLL it names is loaded when the program starts (and copied beside it when it is built). Import is how a program picks its runtime, so every program imports one, near the top:
BBRuntime64.decls - Desktop (DX12)
BBRuntimeVulkan.decls - Desktop (Vulkan)
BBRuntimeWeb.decls - Web (WebGPU)
BBRuntimeWebGL2.decls - Web (WebGL2)
The Target menu has to match: a program that imports another target's runtime stops with a message saying which target to choose. Importing the same file twice is harmless, the second is skipped. To load another .bam file's code, use Include, not Import. To build one file for several targets, put the Import lines in #If ... #EndIf (see Conditional Compiling).
Example
Example.bam
Import "BBRuntime64.decls"
Function Main()
Print "Hello"
Return False
EndFunction