User Tools

Site Tools


5.1 A Gambas Project

In this chapter the question will be examined: What files are necessary for a Gambas project? Admittedly, the answer is especially interesting for purists who want to develop and test their gambas projects without the graphical user interface of Gambas (IDE). On the other hand, the study of the topic “A Gambas Project Internally” provides insights into the complex working methods of Gambas.

5.1.1 Gambas Project - Example

For a Gambas project, you need at least three files in the project folder before you compile for the first time, with the class and form files in a hidden folder called. src. The project file. project is located in the project folder and is also hidden. These three files can be supplemented by additional folders and files. Module files are also located in the. src folder, while files with help texts or images are located in the project folder. Since the content and diction of a form file is not an everyday task when programming with Gambas, the presented project was first developed and tested in the Gambas IDE. In addition, the project to be examined should contain a module and a folder with different images as an icon for the project. Afterwards, all files generated in the IDE and not needed were deleted in the project folder. The project was further developed without IDE and tested with the programs Compiler, Archiver and Interpreter in one console.

Only the following folders and files remained in the project folder' dwconvert':

hans@linux:~$ tree -a $HOME/dwconvert
├── .project
├── .src
│   ├── FMain.class
│   ├── FMain.form
│   └── MS.module
└── symbols
    ├── form_icon.png
    └── project_icon.png
2 directories, 6 files

This is the content of the minimal version of the project file. project that was successfully compiled:


If, for example, the component gb. settings is missing, this error message appears when compiling:

hans@linux:~$ gbc3 --all $HOME/dwconvert
MS.module:4: error: Unknown identifier: Settings

This version of the project file. project contains additional entries, whereby the first two lines are only comments and can therefore be omitted:

# Gambas Project File 3.0
# Compiled with Gambas 3.3.4
Title=Table-conversion OL2DW
Description="Converting a table from OpenLibre to DokuWiki format"
Authors="Hans Lehmann * Osterburg * 2013"

5.1.2 Project test in a console

After minor changes to the source code, the project was compiled and an executable file was created and the program started in a console.

When using the gba3 (Archiver) program with the -v option, it is easy to see which folders and files have been created at the runtime of gba3:

hans@linux:~$ gbc3 --all $HOME/dwconvert
hans@linux:~$ gba3 -v $HOME/dwconvert
Format version: 2
.startup -> .startup
Adding file .startup (109 bytes) -> 0
.project -> .project
Adding file .project (347 bytes) -> 1
symbols -> symbols
Adding directory symbols -> 2
.action -> .action
Adding directory .action -> 3
.gambas -> .gambas
Adding directory .gambas -> 4
symbols/form_icon.png -> /2:form_icon.png
Adding file /2:form_icon.png (2232 bytes) -> 5
symbols/project_icon.png -> /2:project_icon.png
Adding file /2:project_icon.png (337 bytes) -> 6
.gambas/MS -> /4:MS
Adding file /4:MS (1436 bytes) -> 7
.gambas/FMAIN -> /4:FMAIN
Adding file /4:FMAIN (5488 bytes) -> 8
hans@linux:~$ gbx3 $HOME/dwconvert

The program is started with the last statement mentioned above in a console:

Figure Conversion program? OpenLibre2DokuWiki

Ansicht Inhalt Ordner
Figure Contents of the project folder after the first program start

At the first start of the program, the folder lastfile is created and contains a list of the files that were last edited. The maximum number of entries is 5, the oldest entry is deleted when the maximum number of entries has been reached. Depending on the structure of the Gambas project, additional folders such as . hidden or other files like . settings can be created automatically.

The website uses a temporary session cookie. This technically necessary cookie is deleted when the browser is closed. You can find information on cookies in our privacy policy.
k5/k5.1/start.txt · Last modified: 29.01.2022 (external edit)

Page Tools