Board index » delphi » Qbasic -> Pascal

Qbasic -> Pascal

I was wondering if there was a program out there that could translate a
program written in Qbasic (gorilla.bas) into Pascal?  I would appreciate
any responce.

Thank You

 

Re:Qbasic -> Pascal


In article <4ljf3p$...@hihat.mwci.net> in comp.lang.pascal.misc, "Brian

Quote
D. Southwood" <grey...@mwci.net> wrote:
>I was wondering if there was a program out there that could translate a
>program written in Qbasic (gorilla.bas) into Pascal?  I would appreciate
>any responce.

You mean this? ...
'                         Q B a s i c   G o r i l l a s
'
'                   Copyright (C) Microsoft Corporation 1990
'

Does Bill Gates know what you're up to?  he can probably afford more
lawyers than you.
--
John Stockton, Surrey, UK.  J...@merlyn.demon.co.uk  Turnpike v1.12  MIME

Re:Qbasic -> Pascal


In article RRslxJAhbggxE...@merlyn.demon.co.uk, Dr John Stockton <j...@merlyn.demon.co.uk> writes:

Quote
> In article <4ljf3p$...@hihat.mwci.net> in comp.lang.pascal.misc, "Brian
> D. Southwood" <grey...@mwci.net> wrote:
> >I was wondering if there was a program out there that could translate a
> >program written in Qbasic (gorilla.bas) into Pascal?  I would appreciate
> >any responce.

> You mean this? ...
> '                         Q B a s i c   G o r i l l a s
> '
> '                   Copyright (C) Microsoft Corporation 1990
> '

Hi,

The idea of translating QBasic into Pascal already came to my mind,
but I gave up. I was attempting to translate the program manually and it's
rather difficult.

I don't know if anyone out there has already written a program to translate
QBasic into Pascal, but I know it's not very easy.

Problems :

1) QBasic (as any other BASIC language) can use variables which have not been
declared. The translator must built the declarations itself. Difficult but
possible. (So the BASIC program must be read twice : once for retrieving the
variables, and once again for the translation.)

2) The GOSUB statement is a typically BASIC statement and can't easily be
translated into another language. (They use procedures instead.)
Well, GOTO exists in Pascal, but it's advised to avoid using it, since you
can do most of things another way.

If no program exists to translate QBasic into Pascal, you will have to do
it yourself ! If you're patient and have time to do it...  Good luck !

Bye.

Christophe.

Ne perdez pas votre temps visiter cette page car c'est la plus
nulle de tout le Web.
http://www.ens.lifl.fr/~parent

Re:Qbasic -> Pascal


In article <RRslxJAhbggxE...@merlyn.demon.co.uk>,
Dr John Stockton  <j...@merlyn.demon.co.uk> wrote:

Quote
>In article <4ljf3p$...@hihat.mwci.net> in comp.lang.pascal.misc, "Brian
>D. Southwood" <grey...@mwci.net> wrote:
>>I was wondering if there was a program out there that could translate a
>>program written in Qbasic (gorilla.bas) into Pascal?  I would appreciate
>>any responce.

>You mean this? ...
>'                         Q B a s i c   G o r i l l a s
>'
>'                   Copyright (C) Microsoft Corporation 1990
>'

>Does Bill Gates know what you're up to?  he can probably afford more
>lawyers than you.

Do you think he would care? I think he has better things to worry about.
Also I do not see anything wrong in converting a program.

Osmo

Re:Qbasic -> Pascal


In article <4m1sen$...@netserver.univ-lille1.fr>,

Quote
parent christophe <par...@ens.lifl.fr> wrote:

>I don't know if anyone out there has already written a program to translate
>QBasic into Pascal, but I know it's not very easy.

>Problems :

>1) QBasic (as any other BASIC language) can use variables which have not been
>declared. The translator must built the declarations itself. Difficult but
>possible. (So the BASIC program must be read twice : once for retrieving the
>variables, and once again for the translation.)

Is that some problem?

Quote
>2) The GOSUB statement is a typically BASIC statement and can't easily be
>translated into another language. (They use procedures instead.)
>Well, GOTO exists in Pascal, but it's advised to avoid using it, since you
>can do most of things another way.

Gosub is basically same as call in assembler, so it is very easy to
emulate:

Program Lets_eat_spaghetti;

label sub;

Begin
   Write('Going sub for the first time ..');
   asm call sub end;

   Write('Going sub for the second time ..');
   asm call sub end;

   Writeln('Exiting program');
   halt;

sub:

   Writeln(' Returning from the subroutine');
   asm ret end;

End.

Turbo Pascal manual says that one cannot touch SP, but I think that
does not apply if you restore the value before the procedure exits.

Osmo

Re:Qbasic -> Pascal


Quote
>In article <RRslxJAhbggxE...@merlyn.demon.co.uk>,
>Dr John Stockton  <j...@merlyn.demon.co.uk> wrote:
>>In article <4ljf3p$...@hihat.mwci.net> in comp.lang.pascal.misc, "Brian
>>D. Southwood" <grey...@mwci.net> wrote:
>>>I was wondering if there was a program out there that could translate a
>>>program written in Qbasic (gorilla.bas) into Pascal?  I would appreciate
>>>any responce.

>>You mean this? ...
>>'                         Q B a s i c   G o r i l l a s
>>'
>>'                   Copyright (C) Microsoft Corporation 1990
>>'

>>Does Bill Gates know what you're up to?  he can probably afford more
>>lawyers than you.

>Do you think he would care? I think he has better things to worry about.
>Also I do not see anything wrong in converting a program.

Still, it's a matter of principle.  Oh, wait a minute...we're talking about
Microsoft...

Anyway, translating a program is not a copyright violation unless you intend
to sell it, give it away, or otherwise let someone else have it.  Just like a
book.  If you have an original Russian copy of War and Peace and want to sit
down and translate it into English so your 8 year old son can read it, the
Tolstoi estate is not going to come after you.

Besides, the original posting was about how to convert QBasic code into
pascal...not really about any particular program...I think gorilla.bas was
just an example.  And why would anyone want to have a gorilla.pas?

--
BCNU
Daniel J. Wojcik
http://147.35.241.5/mindless/mindless.htm
I am the termite of temptation.
-------------------------------------------------------------
               ~~  ~~
             \(0)--(0)/
                 oo
                ^~~^
                 ^^
Just waiting around for yesterday..

Re:Qbasic -> Pascal


Quote
>And why would anyone want to have a gorilla.pas?

Well, I always thought that gorilla.bas was one of the undocumented
treasures of DOS 5, so a Pascal version would be just fine.

Two oversized monkeys throwing exploding bananas at each other--
what could be better than that?

Regards,
Brian

Re:Qbasic -> Pascal


Quote
In article <1996May1.213922.23...@arl.mil>, woj...@satcom.kaiserslautern.army.mil writes:

[Deletia]

Quote
>Anyway, translating a program is not a copyright violation unless you intend
>to sell it, give it away, or otherwise let someone else have it.  Just like a
>book.  If you have an original Russian copy of War and Peace and want to sit
>down and translate it into English so your 8 year old son can read it, the
>Tolstoi estate is not going to come after you.

>Besides, the original posting was about how to convert QBasic code into
>pascal...not really about any particular program...I think gorilla.bas was
>just an example.  And why would anyone want to have a gorilla.pas?

Yes, but a snakes.pas now...
;-)

Quote
>--
>BCNU
>Daniel J. Wojcik
>http://147.35.241.5/mindless/mindless.htm
>I am the termite of temptation.

Best,

-* Stephen *-
Stephen Posey
University of New Orleans
Email  : S...@uno.edu
WWW    : http://www.uno.edu/~slp

Re:Qbasic -> Pascal


Quote
In article <960502.112113.20...@banshee.uunet.ca>, @rmin.net wrote:
>>And why would anyone want to have a gorilla.pas?
>Well, I always thought that gorilla.bas was one of the undocumented
>treasures of DOS 5, so a Pascal version would be just fine.

>Two oversized monkeys throwing exploding bananas at each other--
>what could be better than that?

A version supporting network play?

Anyway, I think it's better to rewrite the darn thing from scratch, and
use gorilla.bas as a reference for various problems, like drawing or
calculating the path of the banana (or whatever the original poster feel
is a problem).

--
=\
 *=- R.Moberg, CD-Player Pro info @ http://www.sn.no/~mobergru/
=/

Re:Qbasic -> Pascal


Quote
par...@ens.lifl.fr (parent christophe) wrote:
>> >I was wondering if there was a program out there that could translate a
>> >program written in Qbasic (gorilla.bas) into Pascal?  I would appreciate
>> >any responce.

>The idea of translating QBasic into Pascal already came to my mind,
>but I gave up. I was attempting to translate the program manually and it's
>rather difficult.
>Problems :
>1) QBasic (as any other BASIC language) can use variables which have not been
[...]
>can do most of things another way.
>If no program exists to translate QBasic into Pascal, you will have to do
>it yourself ! If you're patient and have time to do it...  Good luck !

Hey, you by any chance didn't start work on this did you?

Re:Qbasic -> Pascal


Quote
parent christophe (par...@ens.lifl.fr) wrote:

: I don't know if anyone out there has already written a program to translate
: QBasic into Pascal, but I know it's not very easy.

: Problems :

: 1) QBasic (as any other BASIC language) can use variables which have not been
: declared. The translator must built the declarations itself. Difficult but
: possible. (So the BASIC program must be read twice : once for retrieving the
: variables, and once again for the translation.)

Nope.   You can set up a table for variables, reserve some space and fill
it up as you go along.

: 2) The GOSUB statement is a typically BASIC statement and can't easily be
: translated into another language. (They use procedures instead.)

Ummmm, procedure/function calls are almost equivalent of GOSUB / RETURN.

Other Threads