Конструктор (constructor) - это метод (подпрограмма или функция), которая выполняется, когда инициализируется объект.
' Gambas class fileA variable has to be global in order for it to be visible in different methods (_new() and Button1_Click()). See How to use local and global variables.
X AS String
STATIC PUBLIC SUB Main() DIM hForm AS Fmain hForm = NEW Fmain hForm.Show END PUBLIC SUB _new() X = "cool" END'The constructor is a method, called: PUBLIC SUB _new()
PUBLIC SUB Button1_Click() TextLabel1.Text = "Constructors are " & X & "!" END