will sometimes appear on a page in this documentation to indicate that there are notes available on how using the feature described on that page differs from accomplishing the same task in VB, to help those programmers who may be migrating to Gambas from that language.
.form and a .class file.
| VB | Gambas | Type of file |
|---|---|---|
| .vbp | .project (just .project, one per directory) | Project definition file |
| .bas | .module | Module |
| .cls | .class | Class file |
| .frm | .form | Form definition file |
| .frx | (whatever you want) | Binary resource files |
/ operator returned an integer if its operands were all integers. For example, PRINT 9 / 2 returned 4 and not 4.5 . Starting with Gambas 0.97, division works more or less the same as VB-style division, with the backslash (\) operator also available to force integer division.
ByVal keyword, so be careful when you try to port a VB project. Also, the contents of object datatypes (array types, collections, objects) are always passed by reference in both languages!
Option Explicit in a VB module, you don't need to declare variables prior to using them. Gambas behaves as if Option Explicit were always turned on, which makes for much better code at the expense of a bit more work.
Index property of VB form controls. You can easily create arrays of controls, but you have to do it in code. There's currently no way to do it graphically. Thus, when you copy a control and paste it back on the form it came from, rather than prompting you to create a control array it automatically renames the copied control to an appropriate name.
Mid$() as an instruction to cut out a substring and put in some other. In Gambas, you can not use it to assign a new substring to it. For example, in VB: MyString = "The dog jumps": Mid$(MyString, 5, 3) = "fox" results in MyString = "The fox jumps". That does not work in Gambas. You must do things like that: MyString = Left$(MyString, 4) & "fox" & Mid$(MyString, 8) .
gb.qt component in Project Properties and make sure you define a Sub Main.
BIG and LITTLE keyword with the OPEN instruction.
[ "Filter 1 (*.foo)" , "Filter 2 (*.bar)" ]
Cancel parameter you can set to prevent the event from being handled normally after your handler is done, so that for instance you can allow only letters or numbers to be typed, perform field validation, or force entry to be all upper or lower case. In Gambas, this is done by using the STOP EVENT instruction.
Mouse.X and Mouse.Y for the mouse coordinates.
Mouse.Left to know if the left button is pressed.
Key.Code to get the code of a key.
Key.Shift to know if the SHIFT key is pressed.