FreeBASIC Skill
FreeBASIC is a free/open source, BASIC compiler for Linux, Windows, and DOS.
Detection
This skill activates when working with FreeBASIC code or projects. Watch for:
File extensions: .bas, .bi
Comments:
' FreeBASIC comment
Language markers:
Dim, Var, Function, Sub, Print, Input, If, For, While
#if, #define, #include (preprocessor)
End Function, End Sub, End Type
- Compiler options:
-lang fb, -lang qb, -lang fblite
- Meta-statements:
$Dynamic, $Static, $Include
Quick Reference
Keywords
| Keyword |
Description |
Doc |
| Dim, Var |
Declare variables |
types.md |
| Function, Sub |
Define procedures |
procedures.md |
| If, Then, Else |
Conditional execution |
control-flow.md |
| For, While, Do |
Loops |
control-flow.md |
| Print, Input |
Console I/O |
basics.md |
| Open, Close, Get, Put |
File I/O |
file-io.md |
| String, Len, Mid |
String operations |
strings.md |
| Screen, Circle, Line |
Graphics |
graphics.md |
API Search
Use the search script to find keywords:
python scripts/search-api.py "print to screen" --top 5
python scripts/search-api.py --name "Print" -v
python scripts/search-api.py --json "array dimension"
python scripts/search-api.py --list-categories
Topic Routing
Language Fundamentals
| Task |
Doc |
| Hello World, first program |
basics.md |
| Variables and data types |
types.md |
| Operators and expressions |
operators.md |
| Control flow (if, for, while) |
control-flow.md |
| Functions and subs |
procedures.md |
| Arrays and dynamic memory |
arrays.md |
| Strings and string functions |
strings.md |
Data Types
| Task |
Doc |
| Integer, Double, Boolean |
types.md |
| User-defined types (UDT) |
user-defined-types.md |
| Pointers and memory |
pointers.md |
| Type casting and conversion |
types.md |
Standard Library
| Task |
Doc |
| File I/O (Open, Print#, Get, Put) |
file-io.md |
| Console I/O (Print, Input, Color) |
basics.md |
| Date and time functions |
date-time.md |
| Math functions (Abs, Sin, Cos) |
math.md |
| Memory allocation |
pointers.md |
Graphics & UI
| Task |
Doc |
| Screen modes and drawing |
graphics.md |
| User input (mouse, keyboard) |
graphics.md |
| Images and sprites |
graphics.md |
Advanced Topics
| Task |
Doc |
| Preprocessor directives |
preprocessor.md |
| Threading and synchronization |
threading.md |
| Error handling (On Error) |
error-handling.md |
| Compiler options and dialects |
compiler.md |
| QB migration guide |
compiler.md |
Syntax Examples
Hello World
Print "Hello, World!"
Variables
Dim As Integer x = 10
Dim As Double pi = 3.14159
Dim As String name = "FreeBASIC"
Arrays
Dim array(0 To 9) As Integer
Dim matrix(1 To 3, 1 To 3) As Double
ReDim Preserve array(0 To 20)
Control Flow
If x > 0 Then
Print "positive"
ElseIf x < 0 Then
Print "negative"
Else
Print "zero"
End If
For i As Integer = 1 To 10
Print i
Next
Do While condition
' ...
Loop
Functions
Function Add(ByVal a As Integer, ByVal b As Integer) As Integer
Return a + b
End Function
Sub SayHello(name As String)
Print "Hello, " + name + "!"
End Sub
Dependencies
- FreeBASIC compiler (fbc)
- Python 3.10+ for search scripts
See Also
1---2name: freebasic3description: FreeBASIC programming language skill for AI code assistants4---56# FreeBASIC Skill78FreeBASIC is a free/open source, BASIC compiler for Linux, Windows, and DOS.910## Detection1112This skill activates when working with FreeBASIC code or projects. Watch for:1314**File extensions:** `.bas`, `.bi`1516**Comments:**17```freebasic18' FreeBASIC comment19```2021**Language markers:**22- `Dim`, `Var`, `Function`, `Sub`, `Print`, `Input`, `If`, `For`, `While`23- `#if`, `#define`, `#include` (preprocessor)24- `End Function`, `End Sub`, `End Type`25- Compiler options: `-lang fb`, `-lang qb`, `-lang fblite`26- Meta-statements: `$Dynamic`, `$Static`, `$Include`2728## Quick Reference2930### Keywords3132| Keyword | Description | Doc |33|---------|-------------|-----|34| Dim, Var | Declare variables | [types.md](types.md) |35| Function, Sub | Define procedures | [procedures.md](procedures.md) |36| If, Then, Else | Conditional execution | [control-flow.md](control-flow.md) |37| For, While, Do | Loops | [control-flow.md](control-flow.md) |38| Print, Input | Console I/O | [basics.md](basics.md) |39| Open, Close, Get, Put | File I/O | [file-io.md](file-io.md) |40| String, Len, Mid | String operations | [strings.md](strings.md) |41| Screen, Circle, Line | Graphics | [graphics.md](graphics.md) |4243### API Search4445Use the search script to find keywords:4647```bash48python scripts/search-api.py "print to screen" --top 549python scripts/search-api.py --name "Print" -v50python scripts/search-api.py --json "array dimension"51python scripts/search-api.py --list-categories52```5354## Topic Routing5556### Language Fundamentals5758| Task | Doc |59|------|-----|60| Hello World, first program | [basics.md](basics.md) |61| Variables and data types | [types.md](types.md) |62| Operators and expressions | [operators.md](operators.md) |63| Control flow (if, for, while) | [control-flow.md](control-flow.md) |64| Functions and subs | [procedures.md](procedures.md) |65| Arrays and dynamic memory | [arrays.md](arrays.md) |66| Strings and string functions | [strings.md](strings.md) |6768### Data Types6970| Task | Doc |71|------|-----|72| Integer, Double, Boolean | [types.md](types.md) |73| User-defined types (UDT) | [user-defined-types.md](user-defined-types.md) |74| Pointers and memory | [pointers.md](pointers.md) |75| Type casting and conversion | [types.md](types.md) |7677### Standard Library7879| Task | Doc |80|------|-----|81| File I/O (Open, Print#, Get, Put) | [file-io.md](file-io.md) |82| Console I/O (Print, Input, Color) | [basics.md](basics.md) |83| Date and time functions | [date-time.md](date-time.md) |84| Math functions (Abs, Sin, Cos) | [math.md](math.md) |85| Memory allocation | [pointers.md](pointers.md) |8687### Graphics & UI8889| Task | Doc |90|------|-----|91| Screen modes and drawing | [graphics.md](graphics.md) |92| User input (mouse, keyboard) | [graphics.md](graphics.md) |93| Images and sprites | [graphics.md](graphics.md) |9495### Advanced Topics9697| Task | Doc |98|------|-----|99| Preprocessor directives | [preprocessor.md](preprocessor.md) |100| Threading and synchronization | [threading.md](threading.md) |101| Error handling (On Error) | [error-handling.md](error-handling.md) |102| Compiler options and dialects | [compiler.md](compiler.md) |103| QB migration guide | [compiler.md](compiler.md) |104105## Syntax Examples106107### Hello World108```freebasic109Print "Hello, World!"110```111112### Variables113```freebasic114Dim As Integer x = 10115Dim As Double pi = 3.14159116Dim As String name = "FreeBASIC"117```118119### Arrays120```freebasic121Dim array(0 To 9) As Integer122Dim matrix(1 To 3, 1 To 3) As Double123ReDim Preserve array(0 To 20)124```125126### Control Flow127```freebasic128If x > 0 Then129 Print "positive"130ElseIf x < 0 Then131 Print "negative"132Else133 Print "zero"134End If135136For i As Integer = 1 To 10137 Print i138Next139140Do While condition141 ' ...142Loop143```144145### Functions146```freebasic147Function Add(ByVal a As Integer, ByVal b As Integer) As Integer148 Return a + b149End Function150151Sub SayHello(name As String)152 Print "Hello, " + name + "!"153End Sub154```155156## Dependencies157158- FreeBASIC compiler (fbc)159- Python 3.10+ for search scripts160161## See Also162163- [FreeBASIC Manual](https://www.freebasic.net/wiki/DocToc)164- [Official Website](https://freebasic.net/)165- [Community Forum](https://freebasic.net/forum/)