[an error occurred while processing this directive]

HP OpenVMS Systems

BASIC Translator
Content starts here

Compaq BASIC Translator
User Manual


Previous Contents Index


SUBEND

The VAX BASIC or DEC BASIC SUBEND statement is a synonym for the END statement used in combination with the block keyword SUB. See the END statement for more information on the END statement.

Translated Equivalent

End Sub


SUBEXIT

The VAX BASIC or DEC BASIC SUBEXIT statement is a synonym for the EXIT statement used in combination with the block keyword SUB. See the EXIT statement for more information.

Translated Equivalent

Exit Sub


SUM$

The VAX BASIC or DEC BASIC SUM$ function returns a string whose value is the sum of two numeric strings.

Translated Equivalent

DECBAS_SUM$


Remarks

The algorithm used is simple long-hand addition. For compatibility with VAX BASIC or DEC BASIC, DECBAS_SUM$ raises an Illegal Number error if either input string exceeds 60 characters.

SWAP%

The VAX BASIC or DEC BASIC SWAP% function transposes a WORD integer's bytes.

Translated Equivalent

DECBAS_SWAP%


Remarks

The SWAP% function takes a WORD parameter and returns another WORD with the bytes swapped. DECBAS_SWAP% takes any data type and strips off any bits beyond the least significant l6. Then it swaps the bytes of the resulting value and returns it as an INTEGER.

TAB

When used inside the VAX BASIC or DEC BASIC PRINT statement, the TAB function moves the cursor or print mechanism to a specified column. When used outside the VAX BASIC or DEC BASIC PRINT statement, the TAB function creates a string containing the specified number of spaces.

Translated Equivalent

Inside PRINT Statement
DECBAS_TAB

Outside PRINT Statement
Space


Remarks

Inside a PRINT statement, TAB(n) is split into two parameters to the DECBAS_PRINT routine call. The first parameter is n (the number of the column tab), and the second parameter is the constant DECBAS_TAB.

Example

VAX BASIC or DEC BASIC Input (Inside PRINT Statement)


A = TAB(20)
Translator Output


A=SPACE$(20)
VAX BASIC or DEC BASIC Input (Outside PRINT Statement)


PRINT A;TAB(20);B
Translator Output


DECBAS_PRINT 0,A,DECBAS_SEMI,(20),DECBAS_TAB+DECBAS_SEMI,B,DECBAS_EOL

TAN

The VAX BASIC or DEC BASIC TAN function returns the tangent of an angle in radians or degrees.

Translated Equivalent

Tan


Remarks

Visual Basic supports angles measured in radians only.

TIME

The VAX BASIC or DEC BASIC TIME function returns the time of day (in seconds) as a floating-point number. The TIME function can also return process CPU time and connect time.

Translated Equivalent

DECBAS_TIME


Remarks

The functions for returning the CPU time of the current process and the connect time of the current process are not implemented and always return 0 (zero) if specified.

TIME$

The VAX BASIC or DEC BASIC TIME$ function returns a string displaying the time of day in the form hh:mm A.M. or hh:mm P.M.

Translated Equivalent

DECBAS_TIMES


TRM$

The VAX BASIC or DEC BASIC TRM$ function removes all trailing blanks and tabs from a specified string.

Translated Equivalent

RTrim


UBOUND

The VAX BASIC or DEC BASIC UBOUND function returns the upper bounds of a compile-time or run-time dimensioned array.

Translated Equivalent

UBound


UNLESS

The VAX BASIC or DEC BASIC UNLESS qualifier modifies a statement. The compiler executes the modified statement only if a conditional expression is false.

Translated Equivalent

If Not conditional-expression


UNLOCK

The VAX BASIC or DEC BASIC UNLOCK statement unlocks the current record or bucket locked by the last FIND or GET statement.

Translated Equivalent

DECBAS_UNLOCK


Example

VAX BASIC or DEC BASIC Input


UNLOCK #3%
Translator Output


DECBAS_UNLOCK 3

UNTIL

The VAX BASIC or DEC BASIC UNTIL statement marks the beginning of an UNTIL loop or modifies the execution of another statement.

Translated Equivalent

While Not conditional-expression


UPDATE

The VAX BASIC or DEC BASIC UPDATE statement replaces a record in a file with the record in the record buffer. The UPDATE statement is valid on sequential, relative, and indexed files.

Translated Equivalent

DECBAS_UPDATE CHANNEL:= channel

[ ,COUNT_SIZE:= int-exp ]


Remarks

For local relative and sequential files, the Translator does not support the COUNT clause. These files have fixed record length in Visual Basic.

Example

VAX BASIC or DEC BASIC Input


UPDATE #4, COUNT 3
Translator Output


DECBAS_UPDATE CHANNEL:= 4,COUNT_SIZE:= 3

VAL

The VAX BASIC or DEC BASIC VAL function converts a numeric string to a floating-point value.

Translated Equivalent

Val


Remarks

Visual Basic is more tolerant of the strings given. For example, both VAX BASIC or DEC BASIC and Visual Basic return 345 when given the following:


VAL("3 45")
Alternatively given the following example, VAX BASIC or DEC BASIC returns an error message and Visual Basic returns 1615198 :


VAL("1615 198th street N.E.")

VAL%

The VAX BASIC or DEC BASIC VAL% function converts a numeric string to an integer.

Translated Equivalent

DECBAS_VALP


Remarks

DECBAS_VALP takes into account the VAX BASIC or DEC BASIC rules for valid numeric strings and raises the appropriate ILLNUMERR error message (code 52) if necessary.

VMSSTATUS

VAX BASIC or DEC BASIC VMSSTATUS function returns the underlying OpenVMS condition code when control is transferred to a VAX BASIC or DEC BASIC error handler.

Translated Equivalent

None


Remarks

The Translator does not support conversion of the VAX BASIC or DEC BASIC VMSSTATUS function.

WAIT

The VAX BASIC or DEC BASIC WAIT statement specifies the number of seconds that the program waits for terminal input before signaling an error.

Translated Equivalent

DECBAS_WAIT


Example

VAX BASIC or DEC BASIC Input


WAIT 60
Translator Output


DECBAS_WAIT 60

WHEN ERROR

The VAX BASIC or DEC BASIC WHEN ERROR statement marks the beginning of a WHEN ERROR construct. The WHEN ERROR construct contains a protected region and can include an attached handler or identify a detached handler.

Translated Equivalent

On Error GoTo DECBAS_nnnnnn


Remarks

Because the translated Visual Basic On Error GoTo statements do not work in precisely the same way as the VAX BASIC or DEC BASIC WHEN statements, you should review all translated error handling code to verify that it works correctly with the conditions that the program encounters. For more information, see Chapter 6.

Examples

VAX BASIC or DEC BASIC Input (with Detached Handler)


HANDLER HAND1                           ! Handler
    SELECT ERR
CASE = 50
        CONTINUE
CASE ELSE
        EXIT HANDLER
    END SELECT
END HANDLER

Translator Output


GOTO DECBAS_000025
HAND1:                                  ! Handler
    SELECT CASE DECBAS_ERR
CASE=50
        RESUME NEXT
CASE ELSE
        ERR.RAISE NUMBER=ERR.NUMBER
    END SELECT
RESUME NEXT
DECBAS_000025:
VAX BASIC or DEC BASIC Input (Block Example)


WHEN ERROR USE HAND1                    ! WHEN block
    X = Y/0
END WHEN
Translator Output


ON ERROR GOTO HAND1
    X=Y/0
ON ERROR GOTO 0
VAX BASIC or DEC BASIC Input (with Attached Handler)


WHEN ERROR IN                           ! WHEN block
    X = Y/0
USE                                     ! Handler
    SELECT ERR
CASE = 50
 CONTINUE
CASE ELSE
 Y = 0
 RETRY
    END SELECT
END WHEN

Translator Output


ON ERROR GOTO DECBAS_000001             ! WHEN block
    X=Y/0
ON ERROR GOTO 0
GOTO DECBAS_000002
DECBAS_000001:                          ! Handler
    SELECT CASE DECBAS_ERR
CASE=50
        RESUME NEXT
CASE ELSE
        Y=0
        RESUME
    END SELECT
RESUME NEXT
DECBAS_000002:

WHILE

The VAX BASIC or DEC BASIC WHILE statement marks the beginning of a WHILE loop or modifies the execution of another statement.

Translated Equivalent

While


XLATE$

The VAX BASIC or DEC BASIC XLATE$ function translates one string to another by referencing a table string that you supply.

Translated Equivalent

DECBAS_XLATE$

<recto_head>(cancel_h) <verso_head>(cancel_h)


Appendix A
Diagnostic Messages

This appendix lists the Translator messages in four groups, by severity: informational, warning, error, and severe. Within each group, the messages are listed alphabetically by mnemonic.

A.1 Informational Messages

Informational messages indicate Translator differences or changes that the user should be aware of, but that should not affect the meaning of the program.
DEFNODCL Declarations for translated DEFs not needed and not supported
FEANOTREL Feature not relevant in Visual Basic environment
FLAGBP2NOT The /FLAG=BP2COMPATIBILITY qualifier setting is not supported
FORFEEMUS FORM FEED must appear at end of line
IDENDSPSORDS User identifier ending in % or $ made unique by adding underscores
IDHASDOTORDS User identifier contains a dot and/or dollar sign
NODECCONST Visual Basic does not support DECIMAL constants -- changed to DECIMAL variable
NODECSCALE Visual Basic does not support precision and scale---14 bytes used
NOFXSTREXT Visual Basic does not support Fixed Strings within DECLARE, generating Dynamic
NOFXSTRPARM Visual Basic does not support Fixed String parameters, generating Dynamic
NOREADSTMT DATA statements ignored, if no READ statement present
QUALNOTSUP The xxx qualifier is not supported
SHOWCDDNOT The /SHOW=CDD qualifier setting is not supported
SHOWMAPNOT The /SHOW=MAP qualifier setting is not supported
VB4TYPOPT Typed OPTIONAL parameters not supported in Visual Basic Version 4

A.2 Warning Messages

Warning messages indicate problems or Translator changes that change the meaning of the user's program. The program is still a syntactically correct Visual Basic program.
DECIMERR Decimal overflow
FEANOTIDENT Feature not identical to translation, using closest similar word
FEANOTIMP Feature is not yet available
FILEDELETE Any existing file will be deleted; lower versions not kept
FLOPOIERR Floating point error or overflow
HDLRTRANLBL HANDLER translated to mere label
HFLOATNOTS HFLOAT is not supported
IDEMAYAPP IDENT directive may appear only once per module
IDENAMTOO IDENT directive name is too long
ILLCHA Illegal character x
INTERR Integer error or overflow
LEXDIRECUNSUP Lexical directive is unsupported
LIMDECARY Limited DECIMAL Array support---Number of dimensions exceeded
MECHDELETED Mechanism not translated; used on Visual Basic for DLL calls only
MULTASN Multiple assignment targets serialized
NAMTOOLON Name is too long, changed to xxxxxxxxxxx
NESDEFMOV Nested DEF translated to FUNCTION must be moved out of enclosing routine
NOEQUDTYPE No DECIMAL and RFA data types in Visual Basic, translating to VARIANT
NOEXTVAR External Variables and Constants not supported in Visual Basic
NOFORMAPREF Forward reference to MAP/COMMON member found; cannot guarantee previous reference
NOFORRECREF Forward reference to RECORD found, cannot guarantee previous reference
NOFORVARREF Forward reference to RECORD found, cannot guarantee this reference
NOFRAME Compiled procedure is currently not active
NOLOCOFNC The LOC of a function is not currently translatable
NOMAPDYN MAP DYNAMIC and REMAP are not supported in this version; converting to MAP
OPTNOPARMDEF This option has not affected defaults for any parameters of this routine
OPTNOTSUPP This option is not supported
QUASTRTOOLON The /ID_xxx=yyy qualifier value is too long and is truncated
TOOMANYCONT Too many continuation lines for Visual Basic -- edit output to rewrap lines
UNSUPTRANS Untranslatable DEC BASIC feature
VBBYTUNS DEC BASIC Byte (signed) being translated to Visual Basic Byte (unsigned)
VBKEYWDCONF Visual Basic keyword used as user identifier
VBNAMTOOLON Length of respelled name exceeds Visual Basic's limit and is truncated
VBNODESC Visual Basic does not support passing BY DESC, translating to BY REF
VBNOVARNT Visual Basic does not support VARIANT/CASE construct, fields being appended
WHENAPPROX WHEN statement translated to nearest ON ERROR approximation

A.3 Error Messages

Error messages indicate problems that prevent the Translator from producing a syntactically correct Visual Basic program.
AMPCONILL & continuation is illegal after %INCLUDE directive
ARGERR Illegal argument for command
BLTFUNNOT Built in function not supported
CONDATSPC Conflicting data type specifications
DECLEXSYN DECLARED lexical function syntax error
DELETE Ignoring xxx
DIMOUTRAN Dimension is out of range
DUPLNFNDI Duplicate line number xxx found
ENDNOOUT xxx completed with yyy diagnostic(s) - output deleted
ERRACCLIB Error accessing module xxx in text library yyy
ERROPEFIL Error opening file xxx
ERROPELIB Error opening text library xxx
ERRREADFIL Error reading file xxx
EXPIFDIR Expecting IF directive
EXPUNAOPE Expecting unary operator or legal lexical operand
EXTELSFOU Extra ELSE directive found
EXTENDIF Extra END IF directive found
EXTLEFPAR Extra left parenthesis in expression
EXTRIGPAR Extra right parenthesis in expression
FEANOSUPPORT Feature is not supported in this version
FEANOTAVA Language feature not available in DEC BASIC
FEAUNTRANS Feature is untranslatable
FILACCERR File access error for INCLUDE directive file xxx
FOUENDWIT Found end of xxx without matching yyy head
FOUNDMSG1 Found xxx when expecting yyy
FOUNDMSG2 Found xxx when expecting one of: yyy,zzz
FOUNDMSG3 Found keyword xxx when expecting yyy
FOUNDMSG4 Found keyword xxx when expecting one of: yyy,zzz
FUNWHINOT Exit from FUNCTION while not in FUNCTION
IF_EXPMUS IF directive expression must be terminated by THEN directive
IF_IN_INC IF directive in INCLUDE file needs END IF directive in same file
ILLCONTYP Illegal constant type
ILLFRMNAM Illegally formed name
ILLFRMNUM Illegally formed numeric constant
ILLMULDEF Illegal multiple definition of name xxx
ILLNESDEF Illegally nested DEFs
ILLUSEUNA Illegal use of a unary operator
IMPDECNOT Explicit declaration of xxx required
INCDIRSYN INCLUDE directive syntax error
INCSUBUSE Inconsistent subscript use for xxx
INSERTB Assuming xxx before yyy
INSERTM Assuming xxx to match yyy
INTCONEXC Integer constant exceeds machine integer size
INTCONREQ Integer constant required
INVREATYP Invalid REAL type
ITEMUSAPP ITERATE must appear within a loop
LETDIRSYN LET directive syntax error
LEXDIRMUS Directive must be only item on line
LEXDIRSYN Lexical directive syntax error
LEXIDEMUS Lexical identifier must be declared before reference
LINNUMERR2 Illegal line number xxx
LINNUMERR3 Illegal line number
LINNUMINC Line number may not appear in INCLUDE directive file
LINOUTORDE Line numbers are out of order
LOWLSSUP Lower bound must be less than upper bound
LOWNOTVIR Lower bound not permitted with virtual arrays
MACNOTDEF Macro is not defined
MAXDIMEXC Maximum number of dimensions exceeded. Maximum is xxx
MERGE Merged xxx and yyy
MISENDIF Missing END IF directive before end of program unit
MISMATEND Mismatched END, expected xxx
MULDEFLEX Multiple definition of lexical identifier is illegal
NESDEFMOV Nested DEF translated to FUNCTION must be moved out of enclosing routine
NOITERLAB ITERATE statement with label is unsupported
NOLINENUM Missing line number on first line
NOLNROOM Out of memory for line numbers
NONUMCONST Constants not yet supported in this context; please use numeric literal
NOTMACROOM Out of memory for macro definitions
NOVIRTARY Virtual Arrays not translatable, translating to standard Array instead
NUMCONREQ Numeric constant required
OPEEXPNOT Operator expected, not found
OPEMUSFOL Operator must follow right parenthesis
OPTMUSTMOVE OPTION EXPLICIT must be moved out of the routine where it was translated
RADNOTSUP Radix not supported
RECNOTDEF Record type xxx not defined
RECRECDEF Recursive RECORD definition of type xxx
RECTOOBIG Record too big from INCLUDE directive file xxx
RECTOOBIG1 Record too big from module xxx in text library yyy
RECTOOLAR RECORD too large. Limit is 65535 bytes
REPLACE Assuming xxx replaced by yyy
SHRNOTAVL Unable to access the shareable image xxx
SPELL Assuming xxx intended to be the keyword yyy
STRCONREQ String constant required
STRLENNOT String length not allowed on numeric variable xxx
STRLENNOT3 String length not allowed on dynamic string xxx
STRLENNOT4 String length not allowed on numeric variable
STRLENNOT6 String length not allowed on ANY
STRLITREQ String literal required for compiler directive
STROUTRAN String is too large
SUFINTONLY % only allowed with BYTE, WORD, LONG, or INTEGER keywords
SUFNOTALL Suffix not allowed on variable xxx
SUFNOTALL2 Suffix not allowed on variable xxx after data type keyword
SUFNOTALL3 Suffix not allowed on FILL after data type keyword
SUFNOTREC Suffix not allowed for record type xxx
SUFSTRONLY $ is allowed only with STRING keyword
TEXFOLEND Text following end of program unit must be on new BASIC line
TEXFOLENL Text following end of program unit must be on new physical line
TEXLINMSG Text line exceeded 255 characters and is truncated
THEMUSFOL THEN directive must follow a lexical expression
TOOFEWARG Too few arguments
TOOMANYDEST More than 255 ON GOTO/GOSUB destinations is unsupported by Visual Basic
TRANCONF The Translator is confused. Are you sure this is a valid DEC BASIC program?
TYPDEFSTR TYPE default of STRING is not allowed
UNELEXDIR Unexpected lexical directive encountered
UNEXPEOF Unexpected end of file
UNTSTRCNS Unterminated string literal
VBNOFIELD FIELD statement cannot be translated; please use MAPs


Previous Next Contents Index