Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Basic -> C

0 views
Skip to first unread message

Richard Delgado

unread,
Aug 5, 1992, 12:47:02 AM8/5/92
to

I have been told that there exits a basic to C language
translator out there somewhere. Can someone help me. I need
to augment a rather large program written in basic and the
language of choice has since been switched to C. I would prefer
not to do this manually.

Thanks in advance.

Rick

John F. Woods

unread,
Aug 5, 1992, 12:31:50 PM8/5/92
to

Well, I don't have any actual help, but I do have an amusing anecdote.

The one time I had a BASIC program that I wanted to translate into C, it
turned out that it was sufficiently stereotyped that I was actually able
to translate it using an *ed* script (it was a maze generating program).

Giles Todd

unread,
Aug 6, 1992, 5:58:57 PM8/6/92
to

Do not do this thing. You will regret it. One of the crosses I have to
bear is maintenance of a large accounts program which was initially
written in BASIC and automatically converted to C. It is a nightmare
which I would not wish on my worst enemy (e.g. for loops which extend
over thirteen pages of listing, function names like "L5000 ()", all
variables global, ...).

Read the BASIC program, learn what it does and document it. Then throw
away the BASIC source and design and write a C program to do the same
thing. This will save you thousands of units of your favourite currency
in the long run.

Giles.
--
Giles Todd g...@rundart.demon.co.uk (Internet)
Voice: +44 925 33472 Data: +44 925 414696
Rundart Ltd, 5 Brentnall Close, Great Sankey, Warrington, WA5 1XN, UK

Tim Pierce

unread,
Aug 8, 1992, 3:32:16 PM8/8/92
to
Followups are set to comp.lang.misc because this has very little to do
with C in particular.

In article <713139...@rundart.demon.co.uk> g...@rundart.demon.co.uk (Giles Todd) writes:

[on automatic vs. manual BASIC-to-C conversions]

>Read the BASIC program, learn what it does and document it. Then throw
>away the BASIC source and design and write a C program to do the same
>thing. This will save you thousands of units of your favourite currency
>in the long run.

This was all but impossible in the project I worked on last summer. I
was assigned to write a database/calculation package which would take
a large set of data points, perform various calculations on them, and
plot the results. This package had already been written, but mainly
in APL and Basic and badly needed an upgrade. The "perform various
calculations" step was the bottleneck for me; the program which
performed these calculations was a several-hundred-line QuickBASIC
program, which had been translated from GW-BASIC which had been
translated from FORTRAN. The program computed a number of different
characteristics of particular chemical compounds and their physical
properties, and depended strongly on laws of physical chemistry I did
not understand, besides being uncommented and written according to
GW-BASIC one-character variable name standards.

Needless to say, redesigning the BASIC program from scratch and
writing it in C was rather beyond my ken.

My eventual solution: literally translate the program, line-by-line,
and then do whatever I could to make it readable. If I'd had my hands
on an automatic translator, I would have employed that. I was
debugging my hand-translated result for two weeks. But it eventually
worked.

--
____ Tim Pierce / "Bisexual just means you pay for it."
\ / twpi...@amherst.edu /
\/ (BITnet: TWPIERCE@AMHERST) / -- Rock Hudson

0 new messages