Crustacean of Bethany
Crustacean of Bethany is a prospective project since July 14, 2019, to create a partial Gambas (BASIC) to Lazarus (Free Pascal) and vice versa converter tool for simple graphical user interface (GUI) programs. The name is an amalgam of crustacean (from gambas, which means prawns) and Lazarus of Bethany (the Biblical figure supposedly resurrected by Jesus Christ).
This would limitedly allow the creation of Free Pascal programs using of the powerful Gambas integrated development environment (IDE) for rapid application development (RAD), which are also cross-platform as opposed to Gambas' restriction to Unix-like systems. Development is intended to be incremental and bottom-up, with individual features ported over piece by piece as Graham L. Wilson learns how to use Lazarus.
Naturally, it will never be able to produce a 1-1 conversion as there will always be discrepancies in features between the two languages and toolkits; moderate to heavy manual tweaking will be necessary. Best results would ensue from keeping inter-operability in mind when designing the program to be converted.
- uses, type, var, and procedures must be defined in header
- ' becomes // for comments
- ; appended at the end of code lines
- begin opens procedures; end; closes procedures, end. closes units
- No x and y coordinate system properties; see Top and Left
- Text property becomes Caption
- Tag is a 64-bit integer, not a variant
- TObject is the sender for event calls
- Border is BorderStyle
- Top and Left properties are still the same
- Visible property is still the same
- Enabled property is still the same
- Color property is still the same
- Name property is still the same
- Font property is still the same
- Cursor property is still the same
- Align property is still the same
- Alignment property is still the same for text displays
Duplicates for each control must be placed onto the new Lazarus form with matching names, however code generated from the Gambas form file will produce instructions to make them match the position, size, caption and other properties from the Gambas project. These are to be placed in the form creation procedure of the Lazarus Unit file (this could also be done manually if so desired...).
The Class file will be read and converted as best as possible into a Unit file.
Public Sub Form_Open()
procedure TForm1.FormCreate(Sender: TObject); begin
Public Sub Button1_Click()
procedure TForm1.Button1Click(Sender: TObject); begin
The code inside is then converted based on the essential syntactic differences between the languages.
Components And Controls
- TButton - Button
- TLabel - Label
- TFrame - Frame
- TPanel - Panel
- TCheckBox - CheckBox
- TRadioButton - RadioButton
- TEdit - Textbox
- TComboBox - ComboBox