User Tools

Site Tools


k5:k5.0.1:start

5.0.1 Gambas Programs - Overview

The following two calls in one console provide an overview of all relevant Gambas programs, such as the GB compiler or the GB interpreter:

hans@linux:~$ cd /usr/local/bin
hans@linux:/usr/local/bin$ ls -l g*
lrwxrwxrwx 1 root root      14 Okt 31 15:57 gambas3 -> gambas3.gambas
-rwxr-xr-x 1 root root 3720658 Nov 19 19:44 gambas3.gambas
-rwxr-xr-x 1 root root  116451 Nov 19 19:44 gba3
-rwxr-xr-x 1 root root  564804 Nov 19 19:44 gbc3
-rwxr-xr-x 1 root root  113171 Nov 19 19:44 gbi3
lrwxrwxrwx 1 root root       4 Nov 19 19:44 gbr3 -> gbx3
lrwxrwxrwx 1 root root      11 Okt 31 19:24 gbs3 -> gbs3.gambas
-rwxr-xr-x 1 root root   25204 Nov 19 19:44 gbs3.gambas
lrwxrwxrwx 1 root root      11 Okt 31 19:24 gbw3 -> gbs3.gambas
-rwxr-xr-x 1 root root 1924420 Nov 19 19:44 gbx3
hans@linux:/usr/local/bin$
  • gbi3 → Gambas informer
  • gambas3.gambas → Gambas IDE
  • gambas3 → symbolic link to gambas. gambas
  • gbc3 → Gambas compiler
  • gba3 → Gambas-Archiver
  • gbx3 → Gambas interpreter
  • gbr3 → symbolic link to gbx3
  • gbs3.gambas → Gambas scripter
  • gbs3 → symbolic link to gbs3. gambas
  • gbw3 → symbolic link to gbs3. gambas

5.0.1.2 Gambas internal

The chapter' Gambas intern' is dedicated to the following questions: How does Gambas work? Or how and in which hierarchy do the individual programs compilers, archiver and interpreters work together for a Gambas project? The following graphic only represents this hierarchy statically:

Gambas-Architektur
Figure 5.0.1.2.1: Gambas architecture? project, compiler, archiver, interpreter

If you are writing a program in Gambas, then create in a project folder

  • one or more files *. form. A form file contains a description of the desired program interface of the form.
  • one or more files *. class. A class file contains the program code you have written yourself. If there are several files, one of them has the status' Start class'.
  • a (project)file. project that contains information about your project.

This is how Gambas works internally:

  • First, the files listed above are compiled to binary P code by the compiler' gbc3'. The P code is stored in the hidden folder. gambas in the project directory in file (filenames in capital letters). Each class and each module is compiled into a separate file. Based on http://de.wikipedia.org/wiki/P-Code, P code is the instruction set of a pseudo machine (or P machine), i. e. a virtual CPU that executes P code as a machine language. The P-Code was a computer- or CPU-independent code and was part of the development environment UCSD-Pascal. The conversion into the machine language of the CPU is carried out by the interpreter of the P machine.
  • Afterwards, the program Archiver (gba3) generates the executable program from the contents of the file. project and the P code, which is stored in the file projectname. gambas.
  • The. form files are also translated into P code by the compiler. For the graphical components, there is no difference whether you create a. form file in the IDE or generate the forms using the source code.

In the IDE of Gambas applies to a Gambas project:

  • The F7 key starts the compiler' gbc3'.
  • The F5 key starts the compiler one after the other, after successful compilation the archiver' gba3' and then the interpreter' gbx3'. The program is started.
  • The key combination CTRL+ALT+M (“make executable”) starts the compiler and then the archiver and generates an executable file projectname. gambas. For a console, this will bring you to the successful program start:
hans@linux:~$ gbc3 -ag path_to_project_folder
OK
hans@linux:~$ gba3 path_to_project_folder
hans@linux:~$ gbx3 path_to_project_folder

A compiled Gambas archive can only be run with the program' gbr3', because' gbr3' is a symbolic link to gbx3, but behaves differently when called as' gbx3'.

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.0.1/start.txt · Last modified: 29.01.2022 (external edit)

Page Tools