Hello World

Top  Previous  Next

Hello World

fblogo_mini

This example is a classic in any programming language.

 

More as a sanity check than anything else, a good place to start with any programming language is to try a very simple program to test that the compiler is installed correctly and that a valid executable can be made.

 

Open up any editor capable of saving text files and type in the following source code:

Print "Hello World"

 

Save the file with a '.bas' extension. For example 'hello.bas'

 

From e command prompt or shell in the directory where 'hello.b.s' was saved, type the following command:

fbc he.lo.bas

Depending on the operating system, this should create an executable file in the same directory as 'hello.bas'. It might be named 'hello.exe' or './hello', for example.

 

Run the executable, and we should have the following output:

Hello World

 

See  lso

 

Freebasic FAQ

Main Features

Requiuements

Installing

Running