[Gambas-user] Migrating to Gambas

Christof Thalhofer chrisml at deganius.de
Wed Jun 9 10:30:35 CEST 2021


Am 09.06.21 um 01:16 schrieb John Dovey:
> Does anyone have any thoughts/advice about migrating a project from vb6
> to Gambas?
> I found a reference to an old project for migrating some forms, but that
> was for an old version of Gambas.

The migration of some large VBA projects of our firm happened some years
ago.

I could reuse a lot of old code, but I had to create all forms and MS
Access reports new in Gambas. For the reports I created a small
templating system based on LaTeX.

I had found a hidden function in MS Access which could be used to export
the code as .txt so I could copy/paste a lot of code from textfiles into
Gambas, let it run and see what happens.

A lot of code runs as it is, some semantics are different, but after a
while I could refactor quite fast.

Meanwhile, in Gambas 'Dim' doesn't have to be just at the beginning, as
it was before, which i think is a pity because: The 'Dim's spread across
the old code was what pointed out to me the most how bad my old code was
and forced me to refactor it. I found large code blocks with sometimes
duplicate variables (with spurious names) for the same content, often it
was the random result of the undocumented 'trial and error' coding of a
very unexperienced programmer: Me when I was young.

It worked but at the same time it was hardly understandable.

My experience is that migration is not only to make the same piece of
code run in Gambas as it is, but also refactoring the code in a way that
it is cleaner, well documented and better understandable in future.

Look at the code of Gambas itself to figure out how code can be
organized and documented and how variables can be named. I don't know
what your old code is like, but mine was terrible. The time I spent
refactoring and partially reprogramming the thing in a new and better
way was not in vain though, simply because one can continue working much
better afterwards.

Alles Gute

Christof Thalhofer

-- 
Dies ist keine Signatur


More information about the User mailing list