Using the Migration Aid [ HP Business BASIC/XL Migration Guide ] MPE/iX 5.0 Documentation
HP Business BASIC/XL Migration Guide
Using the Migration Aid
1. Run the migration aid.
Run the migration aid using the following command at the colon
prompt:
RUN BBCT3000.PUB.SYS
2. Enter migration aid options.
You can enter any of the following four options at the ">"
migration aid prompt. Enter your chosen options before entering
the CONVERT command. The defaults are OPTION NOREALV and OPTION
MPEV.
OPTION REALV OPTION REALV adds the directive REALV to
PACKFMT statements. The REALV directive tells
native mode programs that the real and short
real data being passed to and from the packed
string is in MPE V real data format.
OPTION NOREALV OPTION NOREALV leaves out the REALV directive.
OPTION MPEXL OPTION MPEXL changes BASIC/V data (BASD) files
to HP Business BASIC/XL data (BDTXL) files.
OPTION MPEV OPTION MPEV changes BASIC/V data (BASD) files
to BASIC/V data (BDATA) files.
3. Use the CONVERT command at the > migration aid prompt.
_________________________________________________________________
NOTE This program warns you when it changes a statement that
might require manual changes to run optimally. It also
flags untranslatable features.
_________________________________________________________________
This is the syntax of the CONVERT command:
{CONVERT} {TO}
{CON } {source} {, }{destination}[SUB][MAIN][comfile]
source The file you want to change. A BASIC/V save
(BASP), fast save (BASFP), or formatted data
(BASD) file.
destination A file that doesn't exist. To list the
changed version of your program at the
terminal, leave out the to file option. This
lets you see what your program will look like,
so you can plan necessary code changes.
SUB Changes the BASIC/V source to an HP Business
BASIC/XL subprogram. Copies the contents of
comfile to the migrated source program. (If
there aren't enough line numbers available, an
error will occur.) This option lets the new
new main program and its subprograms share
data.
MAIN Changes the BASIC/V source to an HP Business
BASIC/XL main program. Copies all COM
declarations to comfile.
comfile An ASCII file that should not have previously
existed.
_____________________________________________________________________
| |
| |
| :RUN BBCT3000.PUB.SYS |
| |
| HP32115A.00.02 BBCT3000 (C)HEWLETT-PACKARD CO 1985 |
| |
| >CONVERT BB3K TO BB |
| |
| Program file conversion complete. |
| No untranslatable features found. |
| |
| >EXIT |
| |
| END OF PROGRAM |
| |
_____________________________________________________________________
4. Type "EXIT" or "E" to exit the migration aid, like in the example
above.
The migration aid will recognize and produce messages about the following
problems:
* INVOKE statement.
* Use of COMPLEX numbers.
* XDB calls with the wrong number of parameters.
* PRINT functions inside PRINT USING statements.
* Use of theUND, SNH, CSH, or TNH defined functions.
* Replacement of the xdbinfo intrinsic with the DBINFO statement.
* Using the FILE statement to share files between programs.
* Lines longer than 500 characters.
* Referencing non-local variables in a multi-line DEF.
* Generation of an invalid PACKFMT statement.
* CHAIN statements.
* Calls to non-BASIC routines requiring EXTERNAL declarations.
The migration aid creates an ASCII version of your program if the source
file was a BASIC/V save (BASP) or a BASIC/V fast save (BASFP) file. If
your source file is a BASIC/V formatted data (BASD), the migration aid
will create an HP Business BASIC/XL formatted data (BDATA) file. Read
the file into the HP Business BASIC/XL interpreter and complete any
necessary manual changes to complete the migration.
You can either read the ASCII file directly into HP Business BASIC/XL
using the GET command or you can edit the file using an editor if you
need to make some manual changes.
You will probably notice some changes when you access the migrated file:
* Two lines were added to the beginning of your file.
* The line numbers were changed.
* Untranslatable statements were changed to comments that include CAUSE
ERROR 1900 statements.
New lines
The following two lines were added to your file:
* Line 1 is a comment. It has the name of the original BASIC/V
program. Notice that "!" is one way of specifying a comment in HP
Business BASIC/XL.
* Line 2 has some GLOBAL OPTIONS on it. This ensures that your program
behaves the same in HP Business BASIC/XL as it did in BASIC/V. OPTION
BASE 1 sets the default lower bound for arrays to 1. Without this
statement, the default lower bound would be zero. OPTION REAL
specifies that undeclared variables default to the SHORT REAL (32-bit
floating point binary) type instead of DECIMAL. COPTION NO ERROR
HANDLING disables the ON ERROR feature of HP Business BASIC/XL in
compiled programs. This improves efficiency. The RANDOMIZE
statement generates a new seed for later calls to the RND function.
Without this statement, the same sequence of random numbers would be
generated for each run of the program.
Refer to the HP Business BASIC/XL Reference Manual for more
information about these options.
Changed line numbers
All the line numbers were multiplied by 10 because sometimes one BASIC/V
line changes into more than one HP Business BASIC/XL line. The highest
legal line number in HP Business BASIC/XL is 999999.
Your multiline user functions were moved to the end of the program.
200,000 was added to each line in each multiline function.
Table 11-2. Changed Line Numbers
----------------------------------------------------------------------------------------------
| | | |
| BASIC/V Version | ASCII Version | HP Business BASIC/XL Version |
| | | |
----------------------------------------------------------------------------------------------
| | | |
| | 1 !to file | 1 !to file |
| | | |
----------------------------------------------------------------------------------------------
| | | |
| | 2 GLOBAL OPTION | 2 GLOBAL OPTION |
| | | |
----------------------------------------------------------------------------------------------
| | | |
| 10 DIM A(5) | 100 DIM A(5) | 100 DIM A(5) |
| | | |
----------------------------------------------------------------------------------------------
| | | |
| 20 REM Print argument | 200 REM Print argument | 200 REM Print argument |
| | | |
----------------------------------------------------------------------------------------------
| | | |
| 30 DEF FNB(X) | 200300 DEF FNB(X) | 700 MAT A=ZER |
| | | |
----------------------------------------------------------------------------------------------
| | | |
| 40 PRINT (X) | 200400 PRINT (X) | 800 Y=FNB(A(1)) |
| | | |
----------------------------------------------------------------------------------------------
| | | |
| 50 RETURN 0 | 200500 RETURN 0 | 900 END |
| | | |
----------------------------------------------------------------------------------------------
| | | |
| 60 FNEND | 200600 FNEND | 200300 DEF FNB(X) |
| | | |
----------------------------------------------------------------------------------------------
| | | |
| 70 MAT A=ZER | 700 MAT A=ZER | 200400 PRINT X |
| | | |
----------------------------------------------------------------------------------------------
| | | |
| 80 Y=FNB(A(1)) | 800 Y=FNB(A(1)) | 200500 RETURN 0 |
| | | |
----------------------------------------------------------------------------------------------
| | | |
| 90 END | 900 END | 200600 FNEND |
| | | |
----------------------------------------------------------------------------------------------
NOTE Note that these lines are in the same positions in the ASCII file
as they were in your original program, but when HP Business
BASIC/XL reads in the file, they are put into numeric order.
Declare variables in COM statements or pass them as parameters to
multiline functions because multiline functions are separate subunits in
HP Business BASIC/XL. Otherwise, multiline functions will not have access
to the local variables declared in the MAIN program unit.
NOTE Line numbers are not changed on REM lines in front of multiline
functions. These lines will probably not be directly in front of
the function in the migrated program. This only affects how your
program looks; your program will act the same.
Changed Untranslatable Statements
The migration aid changes untranslatable statements to comments that
contain CAUSE ERROR 1900 statements. This helps you find statements that
you need to change and causes a run-time error if you run the program
without changing these statements.
MPE/iX 5.0 Documentation