Re:gw-basic To Qb Basic

 BBS: Inland Empire Archive
Date: 03-13-92 (01:53)             Number: 120
From: RICH GELDREICH               Refer#: NONE
  To: LARRY LUND                    Recvd: NO  
Subj: Re:gw-basic To Qb Basic        Conf: (2) Quik_Bas
> I am a newer programmer and trying to learn this stuff, can someone
> tell me how I can convert all these gw-basic programs to run on QB? It
> seems QB won't run a lot of .bas programs I have. This morning I
> loaded up an old program to study the basic in it called walloons.bas
> and QB stopped on a line with the command DRAW. Thanks.

    This should (hopefully) be real simple. First, go to gwbasic and
load in your program. Then, save your program like this:

SAVE "program.bas", A

    The "A" is very important. Normally, gw-basic encodes all of it's
reserved words(such as PRINT, GOTO, INPUT, etc.) with one byte tokens.
QuickBASIC has a heart-failure over them. The ", A" at the end of the
save tells gwbasic to save the program in ASCII form, or in a raw text
format. After that is completed, you should be able to load in the
program you saved in ASCII form into QuickBASIC without any problems.

    You still might have problems though. Some gw-basic structures are
not valid in QuickBASIC. Here's one of them that will work in GW just
fine but will not work in QB:

10 For A=1 to 20:if Array(A)<>2 then next else print "Found at ";A

    This will cause QB to say "Next Without For Error". To correct this,
you would have to rewrite the code(which sometimes is more trouble than
it is worth). The above line would be rewrote like this:

Found=0
For A=1 to 20
    if Array(A)=2 then
         Found=-1
         exit for
    endif
next
if Found then
    print "Found at ";A
endif

Hope that helps!! (if your converting simple gw-basic programs then you
probably won't have to worry about the for/next thing).

Rich Geldreich

--- RBBSMAIL 17.2A
 * Origin: Computer Co-Op RBBS HST, 609-784-9404 Voorhees
NJ (RBBS-PC 1:266/29)
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET