There's a small script called vb2gb that splits VB .frm files into Gambas .form and .class files automatically.
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
Here it is! -- NelsonFerraz - 30 Aug 2003
| Attachment: | Action: | Size: | Date: | Who: | Comment: |
|---|---|---|---|---|---|
| | action | 1410 | 29 Aug 2003 - 16:35 | NelsonFerraz | vb2gb 0.1 |