Compaq BASIC Translator

Compaq BASIC Translator

User Manual

Order Number: AA--R5WVC--TE


June 1999

This manual describes the Compaq BASIC Translator (formerly known as the DIGITAL BASIC Translator), which is used to translate VAX BASIC and DEC BASIC programs to Visual Basic programs.

Revision/Update Information: This revised manual supersedes the DIGITAL BASIC Translator User Manual, Version 1.1.

Operating System and Version: OpenVMS VAX Version 6.2 through 7.2 or OpenVMS Alpha Version 6.2 through 7.2

Software Version: Compaq BASIC Translator Version 1.2

Compatible Systems: Microsoft Windows NT Versions 3.5
and 4.0
Microsoft Windows 95 and Windows 98

Compatible Software: Visual Basic Version 6.0
VAX BASIC Versions 3.8 and higher
DEC BASIC Versions 1.2 and higher <COMPANY_INFO>(Compaq Computer Corporation\Houston, Texas)


June 1999 <disclaimer_para>

Possession, use, or copying of the software described in this publication is authorized only pursuant to a valid written license from DIGITAL or an authorized sublicensor.

Copyright ©1998, 1999

<print_location>

Compaq and the Compaq logo are registered in the United States Patent and Trademark Office. <trademark_para>(intro\Alpha, DEC, DEC BASIC, DECforms, DIGITAL, OpenVMS, VAX, VAX BASIC, VAX DOCUMENT, VAX RMS, VMS, VT, VT100, and the DIGITAL logo.)

The following are third party trademarks:

BASIC is a registered trademark of the Trustees of Dartmouth College, (Dartmouth Structured Basic) D.B.A. Dartmouth College.

IEEE is a registered trademark of The Institute of Electrical and Electronics Engineers, Inc.

Intel is a registered trademark of Intel Corporation.

Microsoft, MS-DOS, WIN32, Windows, and Windows NT are registered trademarks and MICROSOFT WINDOWS NT, NT, Visual Basic, and Windows 95 are trademarks of Microsoft Corporation.

Motif is a registered trademark of the Open Software Foundation, Inc.

Oracle is a registered trademark and Oracle CDD/Administrator, Oracle CDD/Repository, Oracle CODASYL DBMS, Oracle DBA Workcenter, Oracle Expert, Oracle Graphical Scema Editor, Oracle InstantSQL, Oracle Module Language, Oracle RALLY, Oracle Rdb, Oracle RMU, Oracle RMUwin, Oracle SQL/Services, Oracle TRACE, and Oracle TRACE Collector are trademarks of Oracle Corporation.

All other trademarks and registered trademarks are the property of their respective holders. <cdrom_acknowledgment>(This document is available on CD-ROM.)

This document was prepared using VAX DOCUMENT, Version V3.3-1b.

Contents Index


Preface

This manual describes the use of the Compaq BASIC Translator (also referred to as the Translator, and formerly known as the DIGITAL BASIC Translator), which translates VAX BASIC and DEC BASIC programs to Visual Basic programs.

This manual is in two parts. Part I provides conceptual, general user information on the Compaq BASIC Translator. Topics such as elements of the Translator, the translation process, input/output (I/O), data types, and error handling are covered.

Part II is the alphabetized reference section. The translation or handling of each VAX BASIC and DEC BASIC statement, function, and language construct is provided, with specific migration information and examples where appropriate.

Intended Audience

This manual is intended for application developers who compile, link, and execute their VAX BASIC or DEC BASIC programs on OpenVMS VAX or OpenVMS Alpha systems and who want to migrate to a Windows NT, Windows 95, or Windows 98 environment.

Users will need a working knowledge of VAX BASIC or DEC BASIC and the DIGITAL Command Language (DCL). A working knowledge of Visual Basic and the Windows NT, Windows 95, or Windows 98 platform is also recommended.

Associated Documents

Please read the following documents, which contain important information:

For more information about language element syntax and reference information, see the DEC BASIC and VAX BASIC for OpenVMS Systems Reference Manual.

For more information about Visual Basic, see the Microsoft documentation for Visual Basic.

For information on ODBC installation and setup, see the Microsoft ODBC Programmer's Reference and SDK Guide.

Conventions

Table 1 shows the conventions used in this manual.

Table 1 Conventions Used in This Manual
Convention Description
$ A dollar sign ($) represents the OpenVMS DCL system prompt.
[Return] In interactive examples, a label enclosed in a box indicates that you press that key on the terminal, for example, the Return key.
Example format Examples are sometimes edited for readability, with line breaks occurring at places other than what you see on your screen.
[Ctrl/] x The key combination Ctrl/ x indicates that you must press the key labeled Ctrl while you simultaneously press another key, for example Ctrl/Y or Ctrl/Z.
[KP] n The phrase KP n indicates that you must press the key labeled with the number or character n on the numeric keypad; for example, KP3.
[PF1 ] x A sequence such as PF1 x indicates that you must first press and release the key labeled PF1, then press and release another key.
n A lowercase italic n indicates the generic use of a number.
... A horizontal ellipsis in an example indicates that the preceding element can be repeated one or more times.
.
.
.
A vertical ellipsis indicates the omission of items from a code example or command format. The items are omitted because they are not important to the topic being discussed.
( ) In format descriptions, if you choose more than one option, parentheses indicate that you must enclose the choices in parentheses.
[ ] In format descriptions, brackets indicate that whatever is enclosed is optional; you can select none, one, any, or all of the choices.
{ } In format descriptions, braces surround a required choice of options. You must choose one and only one of the options listed.
boldface text Boldface text denotes user input in online versions of the manual. Visual Basic statement and routine names are bolded and in mixed case.
italic text Italic text represents parameters, arguments, and information that can vary in system messages (for example, Internal error number). Italic text is also used for full manual titles and sometimes for product names.
UPPERCASE Uppercase text indicates the name of a command, a routine, the name of a file, the name of a file protection code, or the abbreviation for a system privilege. Many trademarks are in uppercase, in whole or in part. VAX BASIC or DEC BASIC statements and routines are in uppercase text, for example, ABS. Visual Basic statements and routines are in mixed case and bolded, for example, Abs.

References

The following table shows certain references and their respective meanings in this manual:
Reference Meaning
Translator or DIGITAL BASIC Translator Compaq BASIC Translator (new name as of Version 1.2)
OpenVMS Both the OpenVMS VAX and the OpenVMS Alpha operating systems, unless otherwise specified
Windows Microsoft Windows NT system, Version 3.5 or Version 4.0, or Microsoft Windows 95 or Windows 98 system
Windows NT Microsoft Windows NT system, Version 3.5 or Version 4.0
CDD or
CDD/Repository
The Oracle CDD/Repository software, a product of Oracle Corporation

Sending Compaq Your Comments on This Manual

Compaq welcomes your comments on this or any other DEC BASIC manual. You can send comments in the following ways:

If you have suggestions for improving a particular section or find any errors, please indicate the title, order number, and section (if available).

Compaq also welcomes general comments.

How to Order Additional Documentation

Use Table 2 to order additional documentation or information. If you need help deciding which documentation best meets your needs, call 800--DIGITAL (800--344--4825).

Table 2 Telephone and Direct Mail Orders
Location Call/Fax Write
U.S.A. DECdirect
800--DIGITAL
800--344--4825
Fax:
800--234--2298
Compaq Computer Corporation
P.O. Box CS2008
Nashua, NH 03061
     
Puerto Rico 809--781--0505
Fax:
809--749--8300
Compaq Computer Caribbean, Inc.
3 Digital Plaza, 1st Street, Suite 200
P.O. Box 11038
Metro Office Park
San Juan, Puerto Rico 00910--2138
     
Canada 800--267--6215
Fax:
613--592--1946
Compaq Computer of Canada, Ltd.
Box 1300
100 Herzberg Road
Kanata, Ontario, Canada K2K 2A6
Attn: DECdirect Sales
     
International --- Local Compaq subsidiary or approved distributor
     
Internal Orders DTN: 264--4446
603--884--4446
Fax:
603--884--3960
U.S. Software Supply Business
Compaq Computer Corporation
8 Cotton Road
Nashua, NH 03063--1260


Part 1
Using the Compaq BASIC Translator

Part I provides an overview and a context for using the Compaq BASIC Translator. It also discusses ways to ease the use of the Translator. Topics include concepts and elements of the Translator, its features and limitations, data definition, input and output, and exception handling. <recto_head>(cancel_h) <verso_head>(cancel_h)


Chapter 1
Introduction

Visual Basic is a successful and widely used PC-based development environment. Because of its popularity and the popularity of the Microsoft Windows NT, Windows 95, and Windows 98 platforms (collectively referred to in this manual as "Windows"), Compaq offers the Compaq BASIC Translator (hereafter referred to as "the Translator") for migrating established VAX BASIC or DEC BASIC applications to those PC platforms. The Translator takes VAX BASIC or DEC BASIC source code as input and generates Visual Basic source code that, in combination with the Translator's run-time library (RTL), compiles and executes on Windows.

The Translator runs on the OpenVMS VAX or Alpha platform. It can accurately parse the full set of VAX BASIC and DEC BASIC language constructs because it shares sources (specifically, the lexical analyzer and parser) with these compilers. This avoids misinterpretation of the language. The Translator has its own code generator, which does the translation to Visual Basic code.

1.1 Features of the Translator

In support of the migration process, the Translator:

1.2 Limitations on Translation

Visual Basic is not entirely compatible with VAX BASIC or DEC BASIC, but the Translator and the DECBAS_ support routines together can translate most of the VAX BASIC or DEC BASIC source language. The degree of completeness of the translation depends on the statements, functions, and language constructs used in a specific VAX BASIC or DEC BASIC application.

The Translator issues messages to flag features that are not translatable.

The Translator is compatible with applications written in VAX BASIC Version 3.8 or higher, or DEC BASIC Version 1.2 or higher. The Translator output is compatible with Visual Basic Version 6.0.

Untranslatable Language Features

Many VAX BASIC and DEC BASIC statements, functions, and data types are directly translatable to Visual Basic. The following are not. They require the assistance of the support routines, classes, or additional reworking by hand (see Chapter 3 and Chapter 7 for detail).

Unsupported Features of the Environment

The following features of the OpenVMS programming environment are not language features and therefore are outside the scope of the Translator:

Unsupported VAX BASIC Features

A number of VAX BASIC features are not supported, for the most part for the same reasons they were excluded from the DEC BASIC language (being obsolete, little used, or very complex), as follows:

Other Restrictions on the Translator

The following list summarizes other current restrictions on the Translator:

Certain VAX BASIC or DEC BASIC statements and functions are translated to code that provides features very similar, but not completely identical, to their VAX BASIC or DEC BASIC counterparts. In these cases, the Translator outputs the following diagnostic message:

%DB2VB-W-FEANOTIDENT, feature not identical to translation, using closest similar word

RTL Restrictions

This section summarizes restrictions in the Translator RTL:


Next Contents Index