Trailing-Edge - PDP-10 Archives - integ_tools_tops20_v7_30-apr-86_dumper - tools/compare/basic.hlp
There are 7 other files named basic.hlp in the archive. Click here to see a list.
File: HLP:VAX6.HLP                                Written: 09-Jul-82/MEH
Length: 3 Pages                                   Updated: 12-Jul-82/MEH

     How to Convert DEC-10 BASIC Programs to VAX-11 BASIC Programs

Very  little or no modification is necessary to be able to run your DEC-
10 BASIC programs on the VAX computer. The purpose of this help file  is
to make you aware of any changes that might be necessary as well as make
you aware of some enhancements available in the BASIC on the VAX.

The first thing to do is to transfer your BASIC files from the DEC-10 to
the VAX. You can do this with the TVAX command procedure. Type HELP TVAX
or HELP VAX3 for details.

Once the programs are on the VAX, you will need to rename  the  file  so
that it has the extension .B2S.  To do this  use  the  RENAME command as

    RENAME *.BAS *.B2S

Once this is accomplished, the simplest way to discover what changes, if
any, need to be made is to recompile the programs  with  the  VAX  BASIC
compiler.  Then  make  any  necessary  modifications  indicated  by  the
compiler's  diagnostic  messages.  Feel  free  to  call  the  DEC-10/VAX
consultant  (378-4941)  to  explain  any  diagnostic  messages you don't

To invoke the VAX BASIC compiler type the following command:

    $BASIC/RSX       (After  a  few  seconds  time,  the  compiler  will
                     respond with the Basic prompt.)

When  the  prompt appears, type the following commands substituting your
file name for the example file name: myfile.

    OLD myfile       (This  tells  the compiler the name of the file you
                     want to access.)

    COMPILE          (This  instructs  the  compiler to compile the file
                     found in the command above.)

    BUILD/SEQUENTIAL (This  command builds the necessary binary files so
                     that the program will be able to run on the VAX.)

    EXIT             (This  command  gets  you  out of BASIC and back to
                     command level.)

    $MCR TKB @myfile (This  command uses the binary files created by the
                     compiler to generate an image file.)

    RUN myfile       (This is the command to  start  execution  of  your

The  above sequence of commands is only necessary when the BASIC program
is being compiled for the first time OR after  modifications  have  been
made to it with an editor. At other times, use the RUN command as shown.
Converting to VAX-11 BASIC                                        Page 2


Perhaps the most important incompatability between the two BASICs is the
variable naming conventions. All string variables must end with a dollar
sign  ($).  All  integer variables must end with a percent sign (%). All
real variables end in a space. Therefore, most variable names from  DEC-
10  BASIC  programs  will  be  considered  as  real variables. This only
presents a problem if your program specifically  needs  integer  values.
FOR  NEXT  loops  do NOT need to be modified as they will work with real
variables also.

FILE  and FILES statements have been replaced by more versatile OPEN and
CLOSE statements. In addition, more  versatile  file  handling  commands
have been added. If these are of interest, please contact the Consultant
for specific information.

                      NEW FEATURES OF VAX-11 BASIC

There  are  MANY new features in BASIC.

Here's a sampling:

   o IF-THEN-ELSE,    WHILE-NEXT,    and   UNTIL-NEXT   for   structured

   o Additional mathematical functions such as:
        COMP%       (to compare two values)
        DIF$        (returns the difference of two values)
        PROD$       (returns the product of two values)
        QUO$        (returns the quotient of two values)
        SUM$        (returns the sum of two values)

   o Enhanced  error  handling  allowing  the  use  of  error  routines,
     determining the line that caused the error, the ability  to  resume
     execution after error processing, etc.

   o Enhanced  INPUT  statement allowing a prompt to be included as part
     of the statement.

   o FNEXIT statement to exit from a multi-line function.

   o Enhanced subroutine capabilities using the CALL statement.

   o Enhanced random access file capabilites allowing:
        DELETE      (to delete a record)
        FIND        (to find a specific record)
        GET         (to read a record into a buffer)
        PUT         (to put a record into a buffer)
        UPDATE      (to update a specific record)
        BUFSIZ      (to define the size of the buffer)
Converting to VAX-11 BASIC                                        Page 3

   o COMMON statement to allow for common variables between subprograms.

   o Control-C trapping within programs.

   o Enhanced  string  capabilities allowing translation from strings to
     numeric values (or vice versa).

   o DATE$ and TIME$ functions.

   o KILL statement to delete temporary disk files and NAME statement to
     rename disk files.

All  enhancements  are  documented  in  the BASIC-PLUS-2 users guide and
language reference manuals available from the Consultant  in  424  Clyde

                          FOR MORE INFORMATION

If you need any help converting your BASIC programs to the VAX, please

      Stan Peters       424A Clyde Building     378-6554
or    Matt Hawkes       424  Clyde Building     378-4941

[End of HLP:VAX6.HLP]