Imports
This page explains how to include other files in a LunarBasic program.
Import
Import is handled before parsing. It pulls another LunarBasic source file into the current one.
Import "relative-or-absolute-path.lb"
- The path must be a string literal.
- The file must end with .lb.
- Relative paths are resolved from the importing file.
- Imported files can contain more Import commands.
- Circular imports are a syntax error.
- Imported file names and line numbers are preserved for diagnostics.
- Import "shared.lb"
- Import "lib\math.lb"
System Functions
The complete built-in runtime reference now lives in the dedicated System Functions help section, with a top-level overview page and separate detail pages for each function.
For window setup, use Graphics. It can create or resize the window and can also enter borderless fullscreen mode with its optional third argument.
For plain text stage files, use OpenFile, ReadLine, EndOfFile, and CloseFile.
For in-game text entry, use StartTextInput, GetTextInput$, SetTextInput, ClearTextInput, and StopTextInput.
For user-defined objects created with New, use Free when you are done with them.