FreeBASIC Documentation Index
Auto-generated from FreeBASIC Wiki
Generated: 2026-03-14
Coverage: 789/807 pages
Variable Declaration
Standard Data Types
- BOOLEAN
- BYTE
- UBYTE
- SHORT
- USHORT
- INTEGER
- UINTEGER
- LONG
- ULONG
- LONGINT
- ULONGINT
- SINGLE
- DOUBLE
- STRING
- ZSTRING
- WSTRING
- ENUM
- TYPE (UDT)
- UNION
User Defined Types
- ENUM
- TYPE (UDT)
- CLASS
- UNION
- EXTENDS
- EXTENDS WSTRING
- EXTENDS ZSTRING
- IMPLEMENTS
- FIELD
- OBJECT
- Type (Temporary)
- This
- BASE (member access)
- Type (Alias)
- WITH
- BASE (initializer)
- CONSTRUCTOR
- DESTRUCTOR
- FUNCTION (Member)
- OPERATOR
- OVERRIDE
- PROPERTY
- SUB (Member)
- STATIC (Member)
- VIRTUAL
- ABSTRACT
- CONST (Member)
- PUBLIC: (Access Control)
- PRIVATE: (Access Control)
- PROTECTED: (Access Control)
Assignment Operators
- Operator =[>] (Assign)
- Operator &= (Concatenate and Assign)
- Operator += (Add and Assign)
- Operator -= (Subtract and Assign)
- Operator *= (Multiply and Assign)
- Operator /= (Divide and Assign)
- Operator = (Integer divide and Assign)
- Operator ^= (Exponentiate and Assign)
- Operator Mod= (Modulus and Assign)
- Operator AND= (Conjunction and Assign)
- Operator EQV= (Equivalence and Assign)
- Operator IMP= (Implication and Assign)
- Operator OR= (Inclusive Disjunction and Assign)
- Operator XOR= (Exclusive Disjunction and Assign)
- Operator Shl= (Shift left and Assign)
- Operator Shr= (Shift right and Assign)
- Operator Let (Assign)
- Operator LET() (Assignment)
Arithmetic Operators
- Operator + (Addition)
- Operator - (Subtract)
- Operator * (Multiply)
- Operator / (Divide)
- Operator \ (Integer divide)
- Operator ^ (Exponentiate)
- Operator Mod (Modulus)
- Operator - (Negate)
- Operator Shl (Shift left)
- Operator Shr (Shift right)
Bitwise Operators
- Operator AND (Conjunction)
- Operator EQV (Equivalence)
- Operator Imp (Implication)
- Operator OR (Inclusive Disjunction)
- Operator Not (Complement)
- Operator XOR (Exclusive Disjunction)
Short Circuit Operators
Comparison Operators
- Operator = (Equal)
- Operator <> (Not equal)
- Operator < (Less than)
- Operator <= (Less than or Equal)
- Operator > (Greater than)
- Operator >= (Greater than or Equal)
Pointer Operators
- Operator PROCPTR (Procedure pointer and vtable index)
- Operator STRPTR (String pointer)
- Operator VARPTR (Variable pointer)
- Operator @ (Address of)
KeyPgOpDeref(not available)
Other Operators
- Operator Is (Run-time type information)
- Operator New Expression
- Operator Delete Statement
- SIZEOF
- OFFSETOF
- TYPEOF
Procedures
- SUB
- FUNCTION
- DECLARE
- CALL
- RETURN (from procedure)
- BYVAL
- BYREF (parameters)
- BYREF (function results)
- ANY
- ALIAS (Name)
- OVERLOAD
- CDECL
- STDCALL
- PASCAL
- __FASTCALL
- __THISCALL
- NAKED
- LIB
- ABSTRACT
- VIRTUAL
- OVERRIDE
- CONST (Member)
- STATIC (Member)
- CONSTRUCTOR
- DESTRUCTOR
- CONSTRUCTOR (Module)
- DESTRUCTOR (Module)
- PROPERTY
- OPERATOR
- FUNCTION Pointer
- SUB Pointer
- ... (Ellipsis)
- CVA_ARG
- CVA_COPY
- CVA_END
- CVA_LIST
- CVA_START
- VA_ARG
- VA_FIRST
- VA_NEXT
Branch Statements
Loop Statements
Jump Statements
Modularizing
- NAMESPACE
- USING (Namespaces)
- EXTERN
- EXTERN...END EXTERN
- PRIVATE
- PUBLIC
- EXPORT
- IMPORT
- COMMON
- DYLIBLOAD
- DYLIBFREE
- DYLIBSYMBOL
Preprocessor
- #DEFINE
- #UNDEF
- DEFINED
- #IF
- #IFDEF
- #IFNDEF
- #ELSE
- #ELSEIF
- #ELSEIFDEF
- #ELSEIFNDEF
- #ENDIF
- #MACRO...#ENDMACRO
- #ASSERT
- #ERROR
- #CMDLINE
- #LINE
- #LANG
KeyPgPplibpath(not available)- #PRAGMA
- #PRAGMA RESERVE
- #INCLUDE
- #INCLIB
- $DYNAMIC
- $STATIC
- $INCLUDE
- $LANG
Compiler Meta Commands
- OPTION BASE
- OPTION BYVAL
- OPTION DYNAMIC
- OPTION ESCAPE
- OPTION EXPLICIT
- OPTION GOSUB
- OPTION NOGOSUB
- OPTION NOKEYWORD
- OPTION PRIVATE
- OPTION STATIC
- DEFBYTE
- DEFDBL
- DEFINT
- DEFLNG
- DEFLONGINT
- DEFSHORT
- DEFSNG
- DEFSTR
- DEFUBYTE
- DEFUINT
- DEFULONGINT
- DEFUSHORT
Built-in Predefined Symbols
- DATE
- DATE_ISO
- FB_64BIT
- FB_ANDROID
- FB_ARG_COUNT
KeyPgDdfbargextract(not available)- FB_ARG_LEFTOF
- FB_ARG_LISTEXPAND
- FB_ARG_RIGHTOF
- FB_ARGC
- FB_ARGV
- FB_ARM
- FB_ASM
- FB_BACKEND
- FB_BIGENDIAN
- FB_BUILD_DATE
- FB_BUILD_DATE_ISO
- FB_BUILD_FORK_ID
- FB_BUILD_SHA1
- FB_CYGWIN
- FB_DARWIN
- FB_DEBUG
- FB_DOS
- FB_ERR
- FB_EVAL
- FB_FPMODE
- FB_FPU
- FB_FREEBSD
- FB_GCC
- FB_GUI
- FB_IIF
- FB_JOIN
- FB_JS
- FB_LANG
- FB_LINUX
- FB_MAIN
- FB_MIN_VERSION
- FB_MT
- FB_NETBSD
- FB_OPENBSD
- FB_OPTIMIZE
- FB_OPTION_BYVAL
- FB_OPTION_DYNAMIC
- FB_OPTION_ESCAPE
- FB_OPTION_EXPLICIT
- FB_OPTION_GOSUB
- FB_OPTION_PRIVATE
- FB_OPTION_PROFILE
- FB_OUT_DLL
- FB_OUT_EXE
- FB_OUT_LIB
- FB_OUT_OBJ
- FB_PCOS
- FB_PPC
- FB_PROFILE
- FB_QUERY_SYMBOL
- FB_QUOTE
- FB_SIGNATURE
- FB_SSE
- FB_UNIQUEID
- FB_UNIQUEID_POP
- FB_UNIQUEID_PUSH
- FB_UNIX
- FB_UNQUOTE
- FB_VECTORIZE
- FB_VER_MAJOR
- FB_VER_MINOR
- FB_VER_PATCH
- FB_VERSION
- FB_WIN32
- FB_XBOX
- FB_X86
- FILE
- FILE_NQ
- FUNCTION
- FUNCTION_NQ
- LINE
- PATH
- TIME
- FALSE
- TRUE
Type Casting
- CAST
- CPTR
- CBYTE
- CUBYTE
- CSHORT
- CUSHORT
- CLNG
- CULNG
- CINT
- CUINT
- CLNGINT
- CULNGINT
- CSIGN
- CUNSG
- CSNG
- CDBL
- STR
- WSTR
- VAL
- VALINT
- VALUINT
- VALLNG
- VALULNG
- CBOOL
Bit Operations
Math Functions
String Functions
- INSTR
- INSTRREV
- LCASE
- LEFT
- LEN
- LSET
- LTRIM
- MID (STATEMENT)
- MID (Function)
- RIGHT
- RSET
- RTRIM
- SPACE
- STRING (Function)
- TRIM
- UCASE
- WSPACE
- WSTRING (Function)
- ASC
- BIN
- CHR
- CVD
- CVI
- CVL
- CVLONGINT
- CVS
- CVSHORT
- FORMAT
- HEX
- MKD
- MKI
- MKL
- MKLONGINT
- MKS
- MKSHORT
- OCT
- WBIN
- WCHR
- WHEX
- WOCT
Date and Time
- DATE
- DateAdd
- DateDiff
- DatePart
- DATESERIAL
- DATEVALUE
- DAY
- HOUR
- ISDATE
- MINUTE
- MONTH
- MONTHNAME
- NOW
- SECOND
- SETDATE
- SETTIME
- TIME
- TIMESERIAL
- TIMEVALUE
- TIMER
- YEAR
- WEEKDAY
- WEEKDAYNAME
File I/O
- OPEN
- CLOSE
- (PRINT | ?) #
- INPUT #
- LINE INPUT #
- WRITE #
- GET (File I/O)
- PUT (File I/O)
- EOF
- LOC
- LOF
- SEEK (Statement)
- SEEK (Function)
- FREEFILE
- ACCESS
KeyPgAppend(not available)KeyPgBinary(not available)KeyPgRandom(not available)KeyPgOutput(not available)KeyPgInputfilemode(not available)- READ (File Access)
- READ WRITE (File Access)
- WRITE (File Access)
- BLOAD
- BSAVE
- ENCODING
- LOCK
- UNLOCK
- RESET
- OPEN CONS
- OPEN ERR
- OPEN PIPE
- OPEN SCRN
Memory Operations
- ALLOCATE
- CALLOCATE
- REALLOCATE
- DEALLOCATE
- Operator New Expression
- Operator Delete Statement
- FB_MEMCOPY
- FB_MEMCOPYCLEAR
- FB_MEMMOVE
- CLEAR
- FRE
- PEEK
- POKE
- FIELD
Multi-Threading
- THREADCREATE
- THREADWAIT
- THREADDETACH
- THREADSELF
- THREADCALL
- MUTEXCREATE
- MUTEXDESTROY
- MUTEXLOCK
- MUTEXUNLOCK
- CONDCREATE
- CONDDESTROY
- CONDSIGNAL
- CONDBROADCAST
- CONDWAIT
User Input
- GETKEY
- INKEY
- INPUT
- INPUT()
- LINE INPUT
- WINPUT()
- MULTIKEY
- GETMOUSE
- SETMOUSE
KeyPgGetjoystick(not available)- STICK
- STRIG
Console Functions
- CLS
- WIDTH
- VIEW PRINT
- COLOR
- CSRLIN
- POS
- LOCATE
- SCREEN (Console)
- PRINT / ?
- (PRINT | ?) USING
- WRITE
- SPC
- TAB
- BEEP
- OPEN CONS
- OPEN ERR
- OPEN PIPE
- OPEN SCRN
Operating System Functions
- EXEC
- CHAIN
- RUN
- KILL
- NAME
- FILEATTR
- FILECOPY
- FILEDATETIME
- FILEEXISTS
- FILELEN
- FILESETEOF
- FILEFLUSH
- CURDIR
- CHDIR
- DIR
- EXEPATH
- MKDIR
- RMDIR
- FRE
- COMMAND
KeyPgEnviron(not available)- ISREDIRECTED
- SETENVIRON
- SHELL
- SYSTEM
- WINDOWTITLE
- END (Statement)
Miscellaneous Keywords
- DATA
- READ
- RESTORE
- ASSERT
- ASSERTWARN
- STOP
- INP
KeyPgLprint(not available)- LPOS
- OUT
- WAIT
- BEEP
- SLEEP
- END (Statement)
- AS
- TO
- Is
- STEP
- DO
- END (Block)
- IIF
- LOOP
- NEXT
- THEN
- UNTIL
- WEND
- WHILE
- OFFSETOF
- SIZEOF
- TYPEOF
- LET
- REM
- OPTION()
- SWAP
- ASM
- SADD
- Operator STRPTR (String pointer)
- Operator VARPTR (Variable pointer)
- (POINTER | PTR)
Error Handling
Graphics Keywords
- SCREEN (GRAPHICS)
- SCREENRES
- SCREENSET
- SCREENINFO
- SCREENCONTROL
- SCREENCOPY
- SCREENEVENT
- SCREENGLPROC
- SCREENLIST
- SCREENLOCK
- SCREENUNLOCK
- SCREENSYNC
- SCREENPTR
- FLIP
- PCOPY
- VIEW (GRAPHICS)
- WINDOW
- PSET
- PRESET
- LINE (GRAPHICS)
- CIRCLE
- PAINT
- DRAW
- DRAW STRING
- GET (GRAPHICS)
- PUT (GRAPHICS)
- IMAGECREATE
- IMAGEDESTROY
- IMAGEINFO
- IMAGECONVERTROW
- PMAP
- POINT
- POINTCOORD
- RGB
- RGBA
- PALETTE
- EVENT (message data from ScreenEvent)
- ADD
- ALPHA
- AND (Graphics Put)
- OR (graphics Put)
- XOR (graphics Put)
- TRANS
- PSET (graphics Put)
- CUSTOM
Graphics User Input
2D Drawing Functions
- PSET
- PRESET
- LINE (GRAPHICS)
- CIRCLE
- PAINT
- DRAW
- DRAW STRING
- GET (GRAPHICS)
- PUT (GRAPHICS)
- IMAGECREATE
- IMAGEDESTROY
- IMAGEINFO
- IMAGECONVERTROW
- PMAP
- POINT
- POINTCOORD
- RGB
- RGBA
- PALETTE
- ADD
- ALPHA
- AND (Graphics Put)
- OR (graphics Put)
- XOR (graphics Put)
- TRANS
- PSET (graphics Put)
- CUSTOM
Screen Functions
- SCREEN (GRAPHICS)
- SCREENRES
- SCREENSET
- SCREENINFO
- SCREENCONTROL
- SCREENCOPY
- SCREENEVENT
- SCREENGLPROC
- SCREENLIST
- SCREENLOCK
- SCREENUNLOCK
- SCREENSYNC
- SCREENPTR
- FLIP
- PCOPY
- VIEW (GRAPHICS)
- WINDOW
- VIEW PRINT
Getting Started
Source Files
- Source Files (.bas)
- Header Files (.bi)
- Using Prebuilt Libraries
- Manage Reusable Procedures by Including Source vs Compiled Modules
Lexical Conventions
Variables and Datatypes
- Constants and Enumerations
- Numeric Types
- Strings (string, zstring, and wstring)
ProPgDataConversion(not available)- Constants
- Variables
Arrays
Pointers
References
Declarations
- Implicit Declarations
- Variable Initializers
- Storage Classes
- Variable Scope
- Simple Variable Lifetime vs Scope
- Dynamic Object and Data Lifetime
- Namespaces
- Variable and Procedure Linkage
User Defined Types
- User Defined Types
- Type Aliases
- Type (Temporary)
- Type (UDT/Alias/Temporary) and Union
- Constructors and Destructors (basics)
- Member Procedures
- Properties
- Variable-length member data
- Member Access Rights and Encapsulation
- Operator Overloading
- Iterators
- New and Delete
- Types as Objects
- Composition, Aggregation, Inheritance
- Inheritance Polymorphism
- Constructors, '=' Assignment-Operators, and Destructors (advanced, part #1)
- Constructors, '=' Assignment-Operators, and Destructors (advanced, part #2)
Statements and Expressions
- Differences between Expressions and Statements
- Constant Expressions
- Assignments
- Control Flow Statements
Procedures
- Procedures Overview
- Passing Arguments to Procedures
- Returning Values
- Procedure Scopes
- Calling Conventions
ProPgRecursion(not available)- Callback
- Constructors and Destructors
- Pointers to Procedures
- Variadic Arguments
Graphics
- GfxLib - FreeBASIC graphics library overview
- Graphics Mode Refresh and Anti-Flickering
- Internal graphics formats
- External Graphics File Formats (page to be completed)
- Lite regulation function to be integrated into user loop for FPS control
- Fine-grain procedure for waiting and in-loop procedure for fine-regulating FPS
Multi-Threading
Making Binaries
Preprocessor
Other Topics
- Date Serials
- Radian system of measuring angles
- Error Handling
- Event Handling
- Identifier Look-ups in namespaces and types
Technical Articles
- C Standard Library Functions
- File I/O with FreeBASIC
- Dynamic memory management with FreeBASIC
ProPgRecursionIteration(not available)- OBJECT built-in and RTTI info
- Embed and Access binary Data in Executable
ProPgUseNewDelete(not available)- Emulate a TLS (Thread Local Storage) and a TP (Thread Pooling) feature
Using the Compiler
- Welcome to FreeBASIC
- Getting help with FreeBASIC
- Installing
- Requirements
- Running
- fbc command-line
- Debugging
- Compiler Error Messages
- Tools used by fbc
- Installing gcc for -gen gcc
KeyPgCmdline(not available)
Compiler Options
CompilerOptAt(not available)- Compiler Option: -a
- Compiler Option: -arch
- Compiler Option: -asm
- Compiler Option: -b
- Compiler Option: -buildprefix
- Compiler Option: -c
- Compiler Option: -c
- Compiler Option: -d
- Compiler Option: -dll
- Compiler Option: -dylib
- Compiler Option: -e
- Compiler Option: -earray
- Compiler Option: -earraydims
- Compiler Option: -eassert
- Compiler Option: -edebug
- Compiler Option: -edebuginfo
- Compiler Option: -elocation
- Compiler Option: -entry
- Compiler Option: -enullptr
- Compiler Option: -eunwind
- Compiler Option: -ex
- Compiler Option: -exx
- Compiler Option: -export
- Compiler Option: -forcelang
- Compiler Option: -fpmode
- Compiler Option: -fpu
- Compiler Option: -g
- Compiler Option: -gen
- Compiler Option: -i
- Compiler Option: -include
- Compiler Option: -l
- Compiler Option: -lang
- Compiler Option: -lib
- Compiler Option: -m
- Compiler Option: -map
- Compiler Option: -maxerr
- Compiler Option: -mt
- Compiler Option: -nodeflibs
- Compiler Option: -nolib
- Compiler Option: -noerrline
- Compiler Option: -noobjinfo
- Compiler Option: -nostrip
- Compiler Option: -o
- Compiler Option: -o
- Compiler Option: -p
- Compiler Option: -pic
- Compiler Option: -pp
- Compiler Option: -prefix
- Compiler Option: -print
- Compiler Option: -profgen
- Compiler Option: -profile
- Compiler Option: -r
- Compiler Option: -r
- Compiler Option: -rr
- Compiler Option: -rr
- Compiler Option: -s
- Compiler Option: -showincludes
- Compiler Option: -static
- Compiler Option: -strip
- Compiler Option: -sysroot
- Compiler Option: -t
CompilerOpttarget(not available)- Compiler Option: -v
- Compiler Option: -vec
- Compiler Option: -version
- Compiler Option: -w
- Compiler Option: -Wa
- Compiler Option: -Wc
- Compiler Option: -Wl
- Compiler Option: -x
- Compiler Option: -z
Dialects and Compatibility
Frequently Asked Questions
- Frequently Asked Questions
- Frequently Asked FreeBASIC Graphics Library Questions
- Frequently Asked FB Runtime Library Questions
- Frequently Asked Questions
- DOS related FAQ
- Windows Related FAQ
- Linux Related FAQ
Reference Tables and Auxiliary Pages
- Standard Data Type Limits
- Operator Precedence
- Bitwise Operators Truth Tables
- Escape Sequences
- DOS Keyboard Scancodes
- Default Palettes
- Glossary
- Obsolete Keywords
- Table of ASCII Characters
- Runtime Error Codes
- Comparison of C/C++ and FreeBASIC
- Comparison of integer data types: FreeBASIC vs. C/C++ (using GCC)
- Array Functions
- Error Handling Functions
- ASM