There's a small script called vb2gb that splits VB .frm files into Gambas .form and .class files automatically. Not all controls or properties are supported, and binary .frx files are ignored, but it is quite useful for getting started. In the future, following the introduction of the Gambas perl-compatible regular expression component, this will be implemented in Gambas so that you'll be able to import VB .frm files directly.
The core of the script is a set of Perl regular expressions:
# Strings to translate (vb format => gb format) my %trans = ( '\r' => '', 'VERSION (.+)' => '# Gambas Form File 1.0', 'VB\.(.+)\s+(.+)' => '$2 $1', 'Client(\w+)' => '$1', 'Begin\b' => '{', 'End\b' => '}', 'BorderStyle' => 'Border', 'Caption' => 'Text', 'Command' => 'Button', 'CommandButton' => 'Button', 'ButtonButton' => 'Button', 'Label' => 'TextLabel', '\"(.+)\"' => '("$1")', 'VScrollBar' => 'Scrollbar', 'HScrollBar' => 'Scrollbar' ); # Twips properties that must be converted to pixels my @twips = qw (Top Left Width Height); # Strings we don't know how to translate my @nontrans = qw ( LinkTopic MaxButton MinButton ScaleHeight ScaleMode ScaleWidth ShowInTaskbar TabIndex Picture StartUpPosition Alignment BackStyle );
The script is useful to translate the project interface, but you'll still have to translate some code manually.
See also: Differences from VB
Attachment: | Action: | Size: | Date: | Who: | Comment: |
---|---|---|---|---|---|
![]() | action | 1410 | 29 Aug 2003 - 16:35 | NelsonFerraz | vb2gb 0.1 |