home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frostbyte's 1980s DOS Shareware Collection
/
floppyshareware.zip
/
floppyshareware
/
BOUT
/
BAS2QB20.ZIP
/
BASIC2QB.DOC
next >
Wrap
Text File
|
1991-06-24
|
14KB
|
312 lines
DOCUMENTATION FILE FOR BASIC2QB.EXE VERSION 2.0
= NOTE =
In this text, the term "QuickBASIC" includes the QBASIC
interpreter found in Microsoft MS-DOS Version 5.0 and
later, and the QBASIC interpreter found in the book
"Learn BASIC Now" from Microsoft Press.
I. Distribution
This program is being distributed as shareware. You
are free to copy and distribute this program so long as this
file accompanies it. If you try the program and find you do
use it, you MUST register your copy. In addition to
appeasing your conscience, registration provides the
following benefits:
1. Technical support - Available through CompuServe
Delphi, GEnie and PC-Link. Customized versions of
this software are available to registered users at
no cost.
2. Free updates - Registered users will be sent
upgrades as they become available.
Registration is simple. Just send $10 to the address
listed and a copy of the form on the last page of this file
and you will receive the latest copy of this program.
II. Background
I wrote this program after spending long hours removing
colons from a BASIC program that I was trying to edit. I
had a few new ideas to put into it and placing each
statement on separate lines made debugging easier. But
after I'd finished editing and tried to run the program, the
compiler showed multiple errors in the sections of the
program that I hadn't done any work on. Why, I thought,
would this program work in GW-BASIC and not QuickBASIC since
both are related and supposedly compatible?
Microsoft's only documented requirements for conversion
is that the program be saved in ASCII-text format and that a
few commands had to be in a different format. In actual
practice though, nested IF-THEN statements do not work
properly and in general the compiler has trouble
interpreting multi-statement program lines. The only sort
of conversion software that Microsoft supplies with
QuickBASIC is a program that will remove any line numbers that are not referenced by another line (i.e. via GOTO,
GOSUB, etc.).
That's how we get to BASIC2QB. It's made to take care
of most of the conversions necessary to make a GW-BASIC
program into a QuickBASIC one.
III. Operation
BASIC2QB uses a two-pass conversion system utilizing
"templates" of BASIC program structures. The statement
lines are processed according to how they "fit" the
templates. Any necessary statements (such as "END IF") are
added as needed. The two-pass system is necessary for
removal of unreferenced line numbers and the production of
the referenced line number list.
This program assumes that you are using BASIC programs
that have already been tried and debugged. No effort is
made to check the correctness or completeness of input
source code. BASIC2QB is not guaranteed to produce 100%
error-free code (no program can make that claim). Every
effort has been made to insure that the changes made to the
source code are as error-free as possible. If you find any
problems with the conversion process used in BASIC2QB,
please contact the author so that changes can be made.
WARNING!
The statement processing algorithms cannot distinguish
between a colon used in a statement and one used to
designate a full path name for a drive designation or full
path designation i.e. C: or C:\directory\myfile.bas. If you
use a drive designation or full path name in your program,
you need to review the output to insure that path names have
not been processed.
IV. Features and Benefits
* Fast. The two-pass approach and filter system used by
BASIC2QB insure that the files are processed as rapidly
as possible.
* Easy to use. Program inputs are obtained either
through prompts or through the command line, allowing
use in batch files or by inexperienced users.
* Places individual statements on separate lines. Multi-
statement lines are not necessary in QuickBASIC since
the source code is not loaded into memory at execution
time. Having statements on individual lines makes
future editing easier.
* Converts single line IF-THEN-ELSE statements to block
format. This makes the statements easier to read and
allows for more error-free compiling since QuickBASIC
does not handle single line format well.
* Allows for indentation of the main body of such multi-
line statements as IF-THEN, WHILE-WEND, and FOR-NEXT to
make program structure more apparent.
* Removes unreferenced line numbers. Line numbers are
only required as a label for certain commands (GOTO,
GOSUB, etc.). Line numbers not referenced by one of
these commands are confusing and unnecessary.
* Produces a referenced line number list showing the line
number and the number of times reference is made to it.
This makes program-flow editing easier by showing use
of procedures and allows once-called procedures to be
placed into the program flow, improving execution time
and helping to eliminate "spaghetti code".
* A copy of the output file can be sent directly to the
screen, printer, or both, so the user can view and edit
the output file easier.
V. Requirements
BASIC2QB requires an IBM PC/XT/AT/PS2/clone with at
least one floppy disk drive (although a hard disk or RAM
disk is much faster), 384K RAM (to allow the use of
QuickBASIC - BASIC2QB will run with less than 100K free
RAM), ASCII-text GW-BASIC or BASICA files to be converted
and Microsoft QuickBASIC or QBASIC (BASIC2QB has only been
tested with QuickBASIC version 4.0 and 4.5 but any version
that will accept GW-BASIC or BASICA as source code should
work). BASIC2QB should also work with other BASIC compilers
with minor changes to the source code.
VI. Usage
To use the program, simply type "BASIC2QB <ENTER>".
The program will ask for the input filename, the output
filename and any conversion options you desire. Optionally,
the information can be input from the DOS command line in
the following manner:
BASIC2QB sourcefile [destination file] [switches]
sourcefile File to be converted. If no drive/path
designation is given, the current drive/path
is used.
[destination file] The converted file. If no destination is
listed then the sourcefile name and
drive/path is used with the
extension ".CNV". If the
destination file already exists,
you will be prompted to replace the
existing file or enter a new file
name.
[switches] Use spaces between each.
/D Use Disk for intermediate file storage. If memory
becomes full, the program will automatically switch to
disk storage.
/H Displays Help screen.
/L Provide listing of referenced line numbers in output
file. Along with this list is a count of how many
times the procedure is called. This is useful to show
which procedures are only called once and can be
inserted into the main program flow, which makes the
program run faster.
/P[device] Send output file to any standard printer
output (LPT1 - LPT3, COM1, COM2). Default
setting is LPT1. Allows for hardcopy output
of the converted file.
/R Remove unreferenced line numbers from the output file.
Removing the unreferenced line numbers makes the
program easier to read and debug. Also unreferenced
line numbers are unnecessary in compiled BASIC.
/S Send output text file to the screen. This feature
allows you to view the converted file as it is being
processed.
/Tn Set tabs to n spaces. Default setting is 8 spaces.
Setting indentation allows for easier viewing.
Statements between the ends of WHILE-WEND, FOR-NEXT and
IF-THEN statements are indented by the number of spaces
selected. To save file space, long lines of spaces are
converted to ASCII tab characters in the final output
file.
VII. Acknowledgements
Here's where I get to give out the thank-yous.
To Ben Stong - without your help version 2.0 would not
be. You provided more than just "> 0".
To Scott Ramsey - for listening even though the program
was written in BASIC.
To Jack Dolby - for all the long talks we had.
To the US Navy - for giving me six months in the
Mediterranean Sea with not much else to do.
To Wendy - for listening to me rant and rave even when
she didn't know what the hell I was talking about, and
for being understanding of those long sessions at the
machine.
VIII. History
07/29/90 Initial release date of BASCNVRT.EXE
Original GW-BASIC to QuickBASIC conversion
program.
01/15/91 Release of BASIC2QB.EXE 1.1
Fixed minor bugs in REM and RETURN statement
handling, tabs in source code are now recognized,
and a few of the little things are neater. Very
limited because the code still had some unworkable
bugs.
06/25/91 Release of BASIC2QB.EXE 2.0
Improved error- and statement-handling routines
and vastly improved operation.
IX. Final Notes
THIS PROGRAM IS DISTRIBUTED UNDER THE SHAREWARE CONCEPT
IT IS NOT FREE OR PUBLIC DOMAIN SOFTWARE
USERS ARE REQUIRED TO REGISTER THEIR COPIES
THIS SOFTWARE IS DISTRIBUTED "AS IS" WITH NO WARRANTY OR
GUARANTEE OF ANY KIND. USE OF THIS PRODUCT IS ALLOWED WITH
THE UNDERSTANDING THAT THE AUTHOR WILL BE HELD IN NO WAY
RESPONSIBLE FOR ANY LOSS OR DAMAGE RESULTING FROM THE USE OF
THIS SOFTWARE OR ANY SOURCE CODE GENERATED BY IT. ALTHOUGH
EVERY EFFORT HAS BEEN MADE TO INSURE THAT THE OUTPUT SOURCE
CODE IS AS COMPLETE AND ERROR-FREE AS POSSIBLE, NO WARRANTY
OR GUARANTEE IS MADE OVER THE CORRECTNESS OR COMPLETENESS OF
ANY SOURCE CODE PRODUCED BY THIS PRODUCT. (In simple terms
this means that if you suffer a loss through the use of this
software or any code generated by it, it's not my fault. It
is also up to you to verify the accuracy of the source code
generated by BASIC2QB.)
If you have any questions or problems with the use of
this software, or suggestions for improvement in the
documentation or software, contact me through CompuServe,
Delphi, GEnie, PC-Link or directly:
Michael M. Slivkoff
11033 Edgepark Court Apt. 201
Manassas, VA 22110
(703) 257-0030 (Voice Only)
CompuServe User ID: 73020,132
Delphi Username: KGBMAN
GE Mail Address (GEnie): M.SLIVKOFF2
PC-Link ID: Mikey58
BASCNVRT.EXE and BASIC2QB.EXE Version 1.1 were written in
QuickBASIC 4.5 on a Tandy 1000A computer. Version 2.0 was
written on a Tandy 1000TX computer.
BASIC2QB.EXE and this file Copyright (c) 1989-1991 Michael
M. Slivkoff, All Rights Reserved.
Tandy is a trademark of Tandy Corporation. Microsoft
and GW-BASIC are registered trademarks of Microsoft
Corporation. IBM is a registered trademark of International
Business Machines Corporation. XT and AT are trademarks of
International Business Machines Corporation. CompuServe is
a registered mark of CompuServe Incorporated. Delphi is a
trademark of General Videotex Corporation. GEnie(sm) is a
service mark of GE Information Services. PC-Link is a
service mark of Quantum Computer Services, Inc.
REGISTRATION FOR BASIC2QB
Send this form and $10 (check or money order) to:
Michael M. Slivkoff
11033 Edgepark Court Apt. 201
Manassas, VA 22110
Name: ____________________________________________________
Address: ________________________________ Apt No: _____
City: ___________________ State: ____ Zip: ___________
Telephone (Voice): (______) ______-________
(Data): (______) ______-________
Comments, questions, suggestions or complaints about
BASIC2QB: