Board index » delphi » VB -> Delphi Converters

VB -> Delphi Converters

        Does anyone have experience with the VB to Delphi conversion programs?
I believe I've seen reference to a couple, but am utterly unfamiliar
with them.

        If you have used one, how well does it convert code, forms, etc. Does
it accurately warn you about areas it failed to convert? Are there
program size limitations?

        We have an extremely large VB system, that has a terminal case of
slowness and poorly written code. Basically it was started and
maintained by a less technically oriented group. Ultimately, it will
require a complete re-write - however convincing management of this is
near impossible. A "magic" coverter may well help them accept the
inevitable.

        Again, in this case, the code conversion is of less importance than
the form conversion (since the code, well, sucks). In addition, there
are several places they use VBX's that will be replaced by Delphis'
built-in components - in those areas the form and code would be pretty
much tossed.

        Any feedback will be appreciated!

JHus

 

Re:VB -> Delphi Converters


Quote
jim...@iadfw.net (JHus) wrote:

(deleted)

The only one I've found so far is EarthTrek's Conversion Assistant.
It's listed in the Summer 95 Delphi Power Tools catalog that came with
Delphi. Costs $69 - phone (617) 273-0308.

The book "Delphi Programming Explorer(CD) - Starter Kit" claimed to
have the commercial version of this program in it but IT DOES NOT!
It's only the demo version (which doesn't allow you to save the
output. The disk version of the book also has this demo program.

I have posted this question to a couple of Delphi groups for
alternative but haven't come with anything yet.

Mike

Quote
>JHus

Re:VB -> Delphi Converters


Quote
>Brian{*word*106}ens <dick...@enh.nist.gov> writes:
>j...@mustang.us.dell.com (Randy Howard) wrote:
>[2 long lists of bugs deleted]

        Thank you both. I suspected as much, but actual  experience is
always more reliable. With the problems you had (and some of them are
surprising), I won't consider it, as we're looking at  ~12,000 lines
of VB  code (with several VBX's that will be eliminated entirely).

        Thanks again.

JHus

Re:VB -> Delphi Converters


Quote
jim...@iadfw.net (JHus) wrote:

>    Does anyone have experience with the VB to Delphi conversion programs?
> I believe I've seen reference to a couple, but am utterly unfamiliar
> with them.

I have used Earthtrek's Conversion Assistant (CA), version 2.1.
I have converted several small (maybe 20 pages) Quick Basic
programs (for DOS) to Delphi by first commenting out the things
specific to the DOS version, reading the resultant code into VB,
then saving the project as text which was read into CA.  CA quits
if given half a chance, so everything must be capitalized and
stylized (Sub...    End Sub) as in VB.

The results needed a LOT of fixing.  I am not sure whether it
would have easier to convert everything myself or not, but
starting with CA fixed most of the simple things (= to := or =,
adding ;, etc.) for me.  Since I had about 20 pages in each case,
that may have been worthwhile.

A far-from-exhaustive list of the translation problems:

1)  Some variable specifiers at end of variable name,
particularly $ and %, not acted upon and not removed.

2) x! changed to variable ix..

3) DEFINT not acted upon.

4) One line if then else hopelessly confused.

5) Procedure argument list hopelessly mangled as concerns single,
integer, etc.

6) Print changed to writeln, even when used in variable such as
PrintOrNot=-1

7)  Same thing for Open - made into assign.

8) File number (#3, for example) not converted.

9) / (divide) changed to div whether for floating point or not.

10)  Strange formatting/tab stops - output scattered over the
screen..

11) Totally confused if word _array_ used as variable name.

There are probably quite a few more of these which I have
forgotten, but this gives you an idea.

In my early days with Delphi, I read a BIG VB program into
Conversion Assistant.  I could not get the resulting
conversion to compile even after extensive editing/fixing.  I
never went back to the problem.

I would say CA will do about half of what has to be done.
Sometimes that's better than nothing.  Translating one set
of 20 pages, starting with the DOS version with gosubs and so on,
has now taken at least 10 hours and it isn't right yet.
In my case, I find I have to pore over a printout of the Delphi
code to check everything, select global and local variables as
needed, and re-organize the flow.

Summary: the process is definitely not automatic.

Brian{*word*106}ens

Re:VB -> Delphi Converters


Quote
Brian{*word*106}ens <dick...@enh.nist.gov> writes:
>I have used Earthtrek's Conversion Assistant (CA), version 2.1.
>I have converted several small (maybe 20 pages) Quick Basic
>programs (for DOS) to Delphi by first commenting out the things
>specific to the DOS version, reading the resultant code into VB,
>then saving the project as text which was read into CA.  CA quits
>if given half a chance, so everything must be capitalized and
>stylized (Sub...    End Sub) as in VB.
>The results needed a LOT of fixing.  I am not sure whether it
>would have easier to convert everything myself or not, but
>starting with CA fixed most of the simple things (= to := or =,
>adding ;, etc.) for me.  Since I had about 20 pages in each case,
>that may have been worthwhile.

[long list of bugs deleted]

I have to agree with Brian's analysis here.  My results with EarthTrek's
product have been abysmal.  I sent in a similar, but different list to
their email address on 7/24/95 and have yet to receive a response.  I've
called their tech support number (never got a real person, only a machine)
and left my name/number for a callback since that time.  I've never
receive a single call.  In short, I'll not be doing business with them
again.  If I could get them to even call me back, I'd return the product
for a refund.  Maybe that's their plan :-)

At any rate, here's some more bugs that I sent to them in the email mentioned
above:

1) code generated with line lengths over 127 characters not split (the fact
   that Delphi has this limitation is very frustrating aside for CA.

2) Type declarations are not placed before function prototypes, produces a
   lot of forward "Unknown Type" warnings that could easily be avoided.

3) VB "Len()" functions should be converted to SizeOf() in Delphi for most
   data types.

4) "Long" should become "longint".

5) blank .BAS source lines with spaces or tabs on them only will generate
   a line in the pascal source with only "(  )" on it.  

6) VB function calls without "(" or ")" (unfortunately legal in VB) are
   not parsed correctly.

7) "As Any" declarations confuse the heck out of the parser.

8) Single line if's are munged beyond recognition.

9) Me references aren't handled at all.

10) VB apps with multiple source modules are just all converted and lumped into
    globs.pas and "project name".pas.  All modularity is basically removed.

11) During conversion, a "line too long" error will be generated on some
    source files.  Neither the line number or the file name is given to
    identify the problem.  First of all, there shouldn't be arbitrary line
    length restrictions on the converter.  Despite that, I made sure that all
    lines in the offending source file were <80 chars and it still generates
    the error.  I suspect that it is really some other problem being reported
    incorrectly.

12) I received exactly one cardboard disk shipment container with one disk
    inside.  Luckily there was some very sparse on-line documentation, or
    there would have been nothing.  Not even a license agreement or
    registration card.  Hardly production software.

Quote
>Summary: the process is definitely not automatic.

My summary: the process is not worth the price of admission.  It is far
easier to a few regular expression search/replaces than put up with all
the grief CA gives you.  The lack of any response to email or tech support
numbers is the real kicker.  

--
Randy Howard (j...@mustang.us.dell.com)     Dell Computer Corp.        
Either we are alone in the universe, or we are not.  Either way the concept
is staggering.   -- Arthur C. Clarke

Other Threads