Repository navigation
Functions Errors
Paul Squires edited this page Oct 19, 2026
·
1 revision
Home › Function Finder › Errors and missing values
The functions to return a failure or "no value" that the caller has to check, grouped by what you want to do. The From column says what a program needs before it can call one:
- built-in: nothing; it is always available.
-
std/outcome:#import "std/outcome", thenusing outcometo call it by its bare name.
Jump to: Return a value or the reason it failed · Return a value that may be missing · Catch runtime errors in a handler · Find out what went wrong · Raise an error yourself
| Function | What it does | From |
|---|---|---|
| Result | Holds either a value or the reason it could not be made; a new one counts as failed. | std/outcome |
| Ok | Returns a successful Result holding the value; both types must be written out. | std/outcome |
| Fail | Returns a failed Result holding the reason; both types must be written out. | std/outcome |
| Result.IsOk | Returns true if the Result holds a value rather than a reason for failure. | std/outcome |
| Result.Value | Returns the value by reference; raises an error if the Result failed. | std/outcome |
| Result.Failure | Returns the reason by reference; raises an error if the Result succeeded. | std/outcome |
| Result.ValueOr | Returns the value, or the fallback you pass if the Result failed. | std/outcome |
| Function | What it does | From |
|---|---|---|
| Optional | Holds one value or nothing at all; a new one is empty. | std/outcome |
| Some | Returns an Optional holding the value, its type taken from the argument. | std/outcome |
| None | Returns an empty Optional of the type you write out. | std/outcome |
| Optional.HasValue | Returns true if the Optional holds a value. | std/outcome |
| Optional.Value | Returns the value by reference; raises an error if the Optional is empty. | std/outcome |
| Optional.ValueOr | Returns the value, or the fallback you pass if the Optional is empty. | std/outcome |
| Optional.Clear | Empties the Optional, releasing whatever its value held. | std/outcome |
| Function | What it does | From |
|---|---|---|
| On Error | Sets a label to jump to when a runtime error happens; On Error Goto 0 turns it off. | built-in |
| Local | Marks an On Error handler as belonging to the procedure it is set in. | built-in |
| Function | What it does | From |
|---|---|---|
| Err | Returns the number of the last runtime error, or sets it without jumping. | built-in |
| Erl | Returns the source line of the last runtime error, or 0 if there was none. | built-in |
| Erfn | Returns a pointer to the name of the failing procedure; null unless built with -exx. | built-in |
| Ermn | Returns a pointer to the name of the source file where the last error happened. | built-in |
| Function | What it does | From |
|---|---|---|
| Error | Raises a runtime error by number: jumps to the handler, or ends the program. | built-in |
tiko-lang · Home · Feature Index · Keyword Index · License
FreeBASIC manual pages reproduced under the GNU FDL 1.3.
- Home
- What Is tiko-lang
- Quick Start
- Installing on macOS
- Debugging
- Feature Index
- Compatibility
- FAQ
- AI Cheatsheet
- Generics
- Interfaces
- For Each
- Iterators
- Tuples
- Array Results
- Defer
- Lambdas
- Block Strings
- Partial Types
- String Slices
- Embed
- Typed Variadics
- C Header Import
- Foreign Library Linking
- UString
- Fixed-Width Types
- Nullptr
- String Library
- Format
- Array
- Map
- Set
- LinkedList
- OrderedMap
- OrderedSet
- Sorting
- Optional
- Result
- Smart Pointers
- Date and Time (Chrono)
- Time Zones
- Filesystem
- File Streams
- Config (INI and TOML)
- Codec
- Hash
- UUID
- OS
- Process
- Net
- HTTP and TLS
- Math Library
- Finance
- Logging
- Terminal TUI Library
- PsControls
- tkControls
- sys/win
- Goroutines and Channels
- LLVM Backend
- tiko build
- TIKO_COMPILER
- Variable Declarations
- Standard Data Types
- User Defined Types
- Procedures
- Operators
- Control Flow Statements
- Converting Data Types
- Array Functions
- String Functions
- Mathematical Functions
- Bit Manipulation
- Date and Time Functions
- File I/O Functions
- Console Functions
- User Input (Runtime Library)
- User Input Functions (Graphics Library)
- Screen Functions
- 2D Drawing Functions
- Graphics Library Reference
- Graphics Keyword List
- Memory Functions
- Threading Support Functions
- Error Handling Functions
- Operating System Functions
- Preprocessor
- Intrinsic Defines
- Miscellaneous Keywords
- Modularizing