[Gambas-user] Migrating to Gambas

KKing kicking177 at gmail.com
Wed Jun 9 14:58:32 CEST 2021


Most of our VB6 migration so far have been console based apps, or ones 
that literally only had a handful of buttons so haven't had to delve 
into "Forms" migration too much. But one thing to bear in mind is if you 
used the old shortcut to a field via an "&" in the label description is 
not the same.
You need to add a separate TextLabel field and put e.g. "<u>P</u>review" 
in the Text of the control to get the visual of an underlined "P" in the 
text of "Preview" and then on the form do something like
<<
Public Sub Form_KeyRelease()
   Dim inTest01 As Integer
   inTest01 = Key.Code
    If Key.Alt Then
      Select Case inTest01
        Case 76
          ' do stuff
        Case 80
          ' do stuff
        Case Else
           inTest01 = inTest01
      End Select
    Endif
End
 >>

As people have alluded to (or forthrightly said) will depend on the 
structure of your old code and I am not casting any aspersions!
We always had "DIM" at top of routines and used Option Explicit and a 
certain amount of consistent structure.
Most of our pain with the code I think you have already encountered 
arrays () vs [] and double vs float.
Some more pain was in converting some jet/access mdb usage. When it was 
read-only we used ODBC+mdbtools otherwise we have converted to sqlite.

There is certainly some benefit if the code works and you have a number 
of people familiar with it to migrate not start from scratch.

K


More information about the User mailing list