By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,984 Members | 1,011 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,984 IT Pros & Developers. It's quick & easy.

Getting an old BASIC program to run online

P: n/a
I have the source code to an old BASIC program that a friend of mine
would like to run online. I am a beginner at JS, but I think that it
would be a good choice for the project. My background is in C/C++ and
web development.

Any suggestions that might get me off to a good start here? I can
provide more information if needed, but I am not sure what would be
helpful. The program is 550 lines in what appears to be BASIC and is a
calendar conversion program. You give it a date and it will convert it
into one of many other date reckoning systems (Gregorian, Hebrew,
Egyptian, etc, etc).

Aug 7 '06 #1
Share this Question
Share on Google+
10 Replies


P: n/a
Trippeer,

Is your intention to convert the program from BASIC to JavaScript?

What version of BASIC is the program written in?

If you are just looking for a free BASIC interpreter, you can find several
on-line:

Just Basic http://www.justbasic.com or
Digital Basic http://hp.vector.co.jp/authors/VA008...lish/index.htm or
Chipmunk Basic http://www.nicholson.com/rhn/basic/ or
Small Basic http://smallbasic.sourceforge.net

John Fredrickson

<tr******@gmail.comwrote in message
news:11**********************@i42g2000cwa.googlegr oups.com...
>I have the source code to an old BASIC program that a friend of mine
would like to run online. I am a beginner at JS, but I think that it
would be a good choice for the project. My background is in C/C++ and
web development.

Any suggestions that might get me off to a good start here? I can
provide more information if needed, but I am not sure what would be
helpful. The program is 550 lines in what appears to be BASIC and is a
calendar conversion program. You give it a date and it will convert it
into one of many other date reckoning systems (Gregorian, Hebrew,
Egyptian, etc, etc).

Aug 8 '06 #2

P: n/a
Yes, I would like to convert it to JS. As far as I know, I cannot get
it to run in a web page as is, so I plan on using the source code to
decipher the logic and rewrite it in JS.

I don't know what version of BASIC, but it seems pretty
straightforward. Lots of GOSUBS and GOTOs, and the arrays are populated
with a FOR/NEXT construction with READ and DATA keywords.

John Fredrickson wrote:
Trippeer,

Is your intention to convert the program from BASIC to JavaScript?

What version of BASIC is the program written in?

If you are just looking for a free BASIC interpreter, you can find several
on-line:

Just Basic http://www.justbasic.com or
Digital Basic http://hp.vector.co.jp/authors/VA008...lish/index.htm or
Chipmunk Basic http://www.nicholson.com/rhn/basic/ or
Small Basic http://smallbasic.sourceforge.net

John Fredrickson
Aug 8 '06 #3

P: n/a
tr******@gmail.com wrote on 08 aug 2006 in comp.lang.javascript:
John Fredrickson wrote:
>Trippeer,

Is your intention to convert the program from BASIC to JavaScript?

What version of BASIC is the program written in?

If you are just looking for a free BASIC interpreter, you can find
several on-line:

Just Basic http://www.justbasic.com or
Digital Basic
http://hp.vector.co.jp/authors/VA008...lish/index.htm or Chipmunk
Basic http://www.nicholson.com/rhn/basic/ or Small Basic
http://smallbasic.sourceforge.net
[please do not toppost on usenet]
Yes, I would like to convert it to JS. As far as I know, I cannot get
it to run in a web page as is, so I plan on using the source code to
decipher the logic and rewrite it in JS.

I don't know what version of BASIC, but it seems pretty
straightforward. Lots of GOSUBS and GOTOs, and the arrays are
populated with a FOR/NEXT construction with READ and DATA keywords.
Automatic conversion is impossible, methinks.

Suggestion:
Try to understand the programme and write a JS programme
that has the same effect.

Modern progamming is module oriented, so the "goto" concept, heavily
attacked by Dijkstra in the 1970s, has been removed from the modern
language versions. and rightly so.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Aug 8 '06 #4

P: n/a
Evertjan. wrote:
[...]
Modern progamming is module oriented, so the "goto" concept, heavily
attacked by Dijkstra in the 1970s, has been removed from the modern
language versions.
<quote>
GOTO is found in FORTRAN, Algol, COBOL, SNOBOL, BASIC, Common Lisp, C,
C++, C#, D, Pascal, Perl, PHP6 and many other languages.
</quote>

http://en.wikipedia.org/wiki/GOTO

--
Bart

Aug 9 '06 #5

P: n/a
Bart Van der Donck wrote on 09 aug 2006 in comp.lang.javascript:
Evertjan. wrote:
>[...]
Modern progamming is module oriented, so the "goto" concept, heavily
attacked by Dijkstra in the 1970s, has been removed from the modern
language versions.

<quote>
GOTO is found in FORTRAN, Algol, COBOL, SNOBOL, BASIC, Common Lisp, C,
C++, C#, D, Pascal, Perl, PHP6 and many other languages.
</quote>

http://en.wikipedia.org/wiki/GOTO
"modern language _versions_" of _BASIC_,
thought that was obvious, Bart.

In your <http://en.wikipedia.org/wiki/GOTOlink:

"One famous criticism of GOTO is a 1968 letter by Edsger Dijkstra
called Go To Statement Considered Harmful."

also: <http://en.wikipedia.org/wiki/Edsger_Dijkstra>
or: <http://nl.wikipedia.org/wiki/Edsger_Dijkstra>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Aug 9 '06 #6

P: n/a
Evertjan. wrote:
Bart Van der Donck wrote on 09 aug 2006 in comp.lang.javascript:
<quote>
GOTO is found in FORTRAN, Algol, COBOL, SNOBOL, BASIC, Common Lisp, C,
C++, C#, D, Pascal, Perl, PHP6 and many other languages.
</quote>

http://en.wikipedia.org/wiki/GOTO

"modern language _versions_" of _BASIC_,
thought that was obvious, Bart.
AFAIK GOTO should be present in all Basic versions/variants. I agree it
should not be used too much (just common 'structural' sense), but you
don't need GOTO to write spaghetti code :-)

--
Bart

Aug 9 '06 #7

P: n/a
Bart Van der Donck wrote on 09 aug 2006 in comp.lang.javascript:
Evertjan. wrote:
>Bart Van der Donck wrote on 09 aug 2006 in comp.lang.javascript:
<quote>
GOTO is found in FORTRAN, Algol, COBOL, SNOBOL, BASIC, Common Lisp, C,
C++, C#, D, Pascal, Perl, PHP6 and many other languages.
</quote>

http://en.wikipedia.org/wiki/GOTO

"modern language _versions_" of _BASIC_,
thought that was obvious, Bart.

AFAIK GOTO should be present in all Basic versions/variants. I agree it
should not be used too much (just common 'structural' sense), but you
don't need GOTO to write spaghetti code :-)
That may be your opinion, Bart.
I tend, after many years of doubt, to agree with Dijkstra it should not.

Fact is it is not present in VB and VBS,
the only "modern versions" of Basic I know of..
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Aug 9 '06 #8

P: n/a
Evertjan. wrote:
[...]
Fact is it [GOTO] is not present in VB and VBS,
the only "modern versions" of Basic I know of..
http://msdn2.microsoft.com/en-us/library/69whc95c.aspx

--
Bart

Aug 9 '06 #9

P: n/a
Bart Van der Donck wrote on 09 aug 2006 in comp.lang.javascript:
Evertjan. wrote:
>[...]
Fact is it [GOTO] is not present in VB and VBS,
the only "modern versions" of Basic I know of..

http://msdn2.microsoft.com/en-us/library/69whc95c.aspx
I am disgusted.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Aug 9 '06 #10

P: n/a
Tripper,

There is no automated conversion system that I know of for going from an old
BASIC to JavaScript. It would be best if you analyzed the program and
documented its behavior and then rewote it by hand. A BASIC compiler or
interpreter may come in handy to guarantee that the new JavaScript program
behaves identically to the old BASIC program.

Perhaps you would like to share the BASIC source code so we can experiment
with it.

John Fredrickson

<tr******@gmail.comwrote in message
news:11**********************@75g2000cwc.googlegro ups.com...
Yes, I would like to convert it to JS. As far as I know, I cannot get
it to run in a web page as is, so I plan on using the source code to
decipher the logic and rewrite it in JS.

I don't know what version of BASIC, but it seems pretty
straightforward. Lots of GOSUBS and GOTOs, and the arrays are populated
with a FOR/NEXT construction with READ and DATA keywords.

Aug 10 '06 #11

This discussion thread is closed

Replies have been disabled for this discussion.