Miscellaneous [ HP Business BASIC/XL Migration Guide ] MPE/iX 5.0 Documentation
HP Business BASIC/XL Migration Guide
Miscellaneous
This section includes information about a variety of differences between
BASIC/260 and HP Business BASIC/XL.
Definitions, Packformats and IN DATASET Lists
To make it easier to replace the IN DATASET DIM ALL and IN DATASET USE
ALL statements during migration, write some simple routines for automatic
generation of MERGE files for variable definitions, PACKFMT lists, and IN
DATASET lists instead of rewriting them by hand every place you need
them.
You can implement these routines easily by using DBINFO and formatting
the returned information according to the need. This is also a good
exercise for getting acquainted with the differences between DBINFO in
IMAGE/260 and TurboIMAGE.
Migration Aid Options
Use the available options when you use the migration aid,
BBCT250.PUB.SYS, to perform the automatic part of the file migration
process.
If your programs use softkeys, enable OPTION INPUTLOOPS in the migration
aid BBCT250.PUB.SYS. This option adds some code that causes HP Business
BASIC/XL softkeys to behave more like BASIC/260 softkeys. (See the
SCREEN Input/Output section.)
If you want to use the FORMS/260 compatible forms in HP Business
BASIC/XL, enable OPTION JOINFORM when migrating your forms files.
Otherwise, BBCT250.PUB.SYS changes your forms to VPLUS forms. VPLUS
forms require considerable changes to your programs.
File Redirection in the Interpreter
The HP Business BASIC/XL interpreter allows redirection of its input
command file to a data file. Use this feature to write your own tool to
make specific changes that the migration aid, BBCT250.PUB.SYS, can not
make.
First, prepare a User Defined Command:
_____________________________________________________________________
| |
| |
| CONV prog file=help.pub.<acct> |
| file bascom=!file |
| run HPBB.PUB.SYS;PARM=1;INFO="infile$=""!prog""" |
| |
_____________________________________________________________________
Figure 17-1. File Redirection in the Interpreter
(Creating a User Defined Command)
Next, create the file HELP.PUB.<acct> to include the commands that will
make the additional change:
__________________________________________________________________________
| |
| |
| COPY ALL OUTPUT TO PRINTER |
| DISP "Migration analysis for "+infile$ |
| get infile$ |
| ! get rid of all the comments BBCT250 adds to the source |
| changeq "!** SYNTAX CHANGE" to "" in all |
| changeq "!** UNTRANSLATABLE" to "" in all |
| changeq "!** ADDED LINE" to "" in all |
| ! add additional lines and dummy main |
| 1 GLOBAL OPTION BASE 1,DECIMAL,SUBPROGRAM NONEWCOM |
| MERGE MAIN,2 ! this contains all the COM etc. for a dummy main |
| 101 COPTION SEGMENT="XXXXXX" |
| ! do some very specific changes |
| changeq "DATE$" to "DATE$(1)" in all |
| changeq "! RE-STORE" to "! RESAVE" in all |
| changeq "Prt=8" to "Prt=888" in all |
| cwarnings |
| verify |
| ren |
| indent 5,3 |
| resave |
| ! find some more statements for further considerations |
| find "IN DATASET" |
| find "REQUEST" |
| find "UPALL" |
| find "239" |
| find "DBINFO" |
| find "THREAD" |
| find "Pointer" ! could be your workfile pointer , replace |
| ! with INTEGER variable |
| ! ***** |
| ! and whatever else you want to have checked |
| ! ***** |
| copy all output to display |
| exit |
| |
__________________________________________________________________________
Figure 17-2. File Redirection in the Interpreter (HELP.PUB)
Put every change you want to make in your command file. After careful
investigation of a few of your programs, you can make most necessary
manual changes through this command file.
Besides redirection of the command input file, HP Business BASIC/XL
allows redirection of all its files by providing a certain PARM value.
Here are the HP Business BASIC/XL parameter/file equations:
Table 17-12. HP Business BASIC/XL Parameter/File Equations
---------------------------------------------------------------------------------------------
| | |
| Formal File | Parameter Value |
| | |
---------------------------------------------------------------------------------------------
| | |
| :file bascom | parm=1 |
| | |
---------------------------------------------------------------------------------------------
| | |
| :file basin | parm=2 |
| | |
---------------------------------------------------------------------------------------------
| | |
| :file bascom and basin | parm=3 |
| | |
---------------------------------------------------------------------------------------------
| | |
| :file basout | parm=4 |
| | |
---------------------------------------------------------------------------------------------
| | |
| :file bascom and basout | parm=5 |
| | |
---------------------------------------------------------------------------------------------
| | |
| :file basin and basout | parm=6 |
| | |
---------------------------------------------------------------------------------------------
| | |
| :file bascom and basin and basout | parm=7 |
| | |
---------------------------------------------------------------------------------------------
Key:
* BASCOM = command file
* BASIN = data input
* BASOUT = program output
If the files used for redirection do not exist, HP Business BASIC/XL
programs and the HP Business BASIC/XL interpreter will not run.
Program CLEANUP
As programs are modified in the interpreter, HP Business BASIC/XL builds
and modifies the internal tables that define a program. As changes and
deletions are made, the interpreter is unable to remove all the unneeded
information in these tables. These cluttered tables use space that could
be used for more code. Also, the cluttered tables are written to a BSAVE
file. Therefore, if an HP Business BASIC/XL program is regularly edited,
modified, and saved in a BSAVE file, remember to clean this file
periodically. Execute the following commands to clean the BSAVE file:
GET <bsavefile>
SAVE LIST <name>
GET <name>
RESAVE <bsavefile>
The ANALYST environment in the interpreter tries to calculate how much
recoverable space exists. If you do not know if a file is cluttered, use
this environment to find out. The ANALYST might not catch all the
changes; the cleaning process (above) guarantees that space is not
wasted.
The ANALYST environment in the interpreter can estimate code savings for
certain compiler options.
Compiled GET
The GET statement is only allowed in interpreted programs; GET is not a
compilable statement. However, there is an easy way to code your program
for similar functionality. For details, see the section, "PROGRAM
CONTROL" in this chapter.
EXTERNAL Declarations
Declare each subroutine and multiline function that is not part of the
same source file but that will be called at run time. You can declare
these by using EXTERNAL statements in HP Business BASIC/XL. Include this
code as comments in your HP 260 programs. This is also a good way to
document HP 260 programs. Otherwise, add them manually during migration.
Unsupported Statements and Functions. This section contains a condensed
list of statements and functions that are not supported by HP Business
BASIC/XL.
There is no automatic translation available for these statements. The
lines are marked with a comment such as "!** UNTRANSLATABLE" when you run
the migration aid.
_____________________________________________________________________
| |
| DBCREATE DBRESTORE |
| DBERASE DBSTORE |
| DBMAINT READ DBPASSWORD |
| DBPASS WRITE DBPASSWORD |
| DBPURGE XCOPY |
| DBCLOSE (MODE 4) DBINFO (CLASS 400) |
| IN DATA SET DIM ALL IN DATA SET USE ALL |
| IN DATA SET IN COM IN DATA SET USER REMOTE LIST |
| IN DATA SET FREE PREDICATE (WITH STRING RELATIONAL) |
| SIZE(-1) |
| |
| AREAD$ |
| BLOCK MODE ON # BLOCK MODE OFF # |
| BREAK ON BREAK OFF |
| ECHO ON ECHO OFF |
| ON BREAK # OFF BREAK # |
| ON CONNECT # OFF CONNECT # |
| ON INPUT # OFF INPUT # |
| ON OUTPUT # OFF OUTPUT # |
| ON TRIGGER # OFF TRIGGER # |
| SEND # SEND BREAK # |
_____________________________________________________________________
Figure 17-3. Unsupported Statements and Functions
____________________________________________________________________
| |
| ATTACH # PERFORM |
| BUFFER # PRINT LABEL |
| CATFILE READ LABEL |
| CATLINE RELEASE |
| CHECK READ OFF# REQUEST# |
| CHECK READ ON # RE-STORE BIN |
| DETACH SET DATE TO |
| DIRECT SET TIME TO |
| DOOR LOCK/UNLOCK SPACE DEPENDENT |
| DUPTEST SPACE INDEPENDENT |
| INDIRECT STORE BIN |
| LOAD BIN |
| |
| ASSIGN;EBCDIC ASSIGN;EBCDIK |
| CREATE;CHAR DELETE # |
| DUPLICATE LINPUT # |
| IBMDUMP IBMWREC |
| |
| EDIT IF..THEN..EXIT IF |
| IF..THEN..FOR IF..THEN..NEXT |
| ON DELAY OFF DELAY |
| |
| AVAIL DET (WITH NO PARAMETER) |
| HOLE RES |
| SYSID$ |
| |
| CURSOR OPTIONS: |
| PALL UPALL |
| PL UP |
| IF OF |
| RIF ROF |
| |
| EDIT KEY LIST KEY |
____________________________________________________________________
Figure 17-1. Unsupported Statements and Functions (Continued)
MPE/iX 5.0 Documentation