Programming in FreeBASIC language

The most important commands from FreeBASIC programming language in one place, a unique comparison and each command-operator is shown using a piece of program. Statements-operators of these sample programs are clickable, so with a simple click we have more information available.

Programming language FreeBASIC:


Lexical elements

Lexical elements are numeric, string constants and comments in the code.

Types and variables

Types and variables are closely related because variables are the most important elements of our program in which we store data, partial results of our calculations. Types tell us what data can be stored in variables.

Program structure


Operators

Operators perform an operation between the operands, this operation can be mathematical, logical, or bitwise.
Parenthesis operator: ( )

Statements

Statements are important elements for writing programs. Generally one statement line corresponds to one line program. The main group of the statements are: cycles, program branching and flow control.

FreeBASIC

 i = x * 5
 do while i>0
   if i=10 then
     exit do
   else
     i=i-1
   end if
loop

Examples - FreeBASIC

FreeBASIC

i \ &H0a
27 \ 3
(25 \ 2 + 1) + 2

FreeBASIC

xmin = 0
 ymax = 18446744073709551615
Dim x As ulongint=7001234        ' x = 7001234
Dim y As ulongint= 10250 \ 8    ' y = 1281
y = CULngInt((x * y))     ' z = 8968580754

FreeBASIC

Other pieces of example codes:
do while i>0
   if i=10 then
     exit do
   else
     i=i-1
   end if
loop
Dim x As single= 3.14159265359
&Hff >= y
Dim y As ulongint= 10250 \ 8
(&Hff mod 50 mod 10) mod 2
y = ClngInt((x * y))
Languages: en hu cz sk