Previous | Contents | Index |
The VAX BASIC or DEC BASIC MAT LINPUT statement receives string data from a terminal or terminal-format file and assigns it to string array elements.
The Translator provides a terminal emulation window on your Windows display. This serves as the standard terminal for typical terminal input and output operations, including MAT LINPUT. From this terminal emulation window, MAT LINPUT (as well as MAT LINPUT # from a terminal-format file) works in much the same manner as under VAX BASIC or DEC BASIC. For more information on I/O issues, see Chapter 5. One major behavioral difference between VAX BASIC or DEC BASIC and the Translator is that the Translator cannot create the matrix within the MAT LINPUT function if the matrix (array) does not already exist. If your current VAX BASIC or DEC BASIC code makes use of this feature, you must modify this code before translation to explicitly create the array that is used in the MAT LINPUT statement. The DECBAS_MATLINPUT support routine uses the Variant type as a way to pass arrays into the function. Although the Translator performs a clean translation, note that Visual Basic does not support arrays of fixed-length strings or user-defined types as Variants and will generate a run-time error if used. See the DIM reference item for any functional differences regarding redimensioning arrays (an optional feature of MAT INPUT). The standard Visual Basic ReDim statement is used if redimensioning is requested in MAT LINPUT. As with most of the other Translator statements and functions, use caution when dealing with explicit VAX BASIC or DEC BASIC error codes, which can differ from those in Visual Basic. The Translator attempts to map between VAX BASIC or DEC BASIC and Visual Basic error codes, but some codes do not convey equivalent meanings. It is important that you check and test each usage of error codes.
VAX BASIC or DEC BASIC Input
MAT LINPUT A1(1,2), A3(4), A5, A6(7,8) |
DECBAS_MATLINPUT 0, A1,1,2, A3,4,, A5,, , A6,7,8 |
The VAX BASIC or DEC BASIC MAT PRINT statement prints the contents of a one- or two-dimensional array on your terminal or assigns the value of each array element to a record in a terminal-format file.
The Translator provides a terminal emulation window on the Windows display. This serves as the standard terminal for typical terminal input and output operations, including MAT PRINT. From this terminal emulation window, MAT PRINT (as well as MAT PRINT # from a terminal-format file) works in much the same manner as under VAX BASIC or DEC BASIC. For more information on I/O issues, see Chapter 5. One major behavioral difference between VAX BASIC or DEC BASIC and the Translator is that the Translator cannot create the matrix for you within the MAT PRINT function if the matrix (array) does not already exist. If your current VAX BASIC or DEC BASIC code makes use of this feature, you must modify this code before translation to explicitly create the array that is used in the MAT PRINT statement. The DECBAS_MATPRINT support routine uses the Variant type as a way to pass arrays into the functions. Although the Translator performs a clean translation, note that Visual Basic does not support arrays of fixed-length strings or user-defined types as Variants and will generate a run-time error if used. As with most of the other Translator statements and functions, use caution when dealing with explicit VAX BASIC or DEC BASIC error codes, which can differ from those in Visual Basic. The Translator attempts to map between VAX BASIC or DEC BASIC and Visual Basic error codes, but some codes do not convey equivalent meanings. It is important that you check and test each usage of error codes.
VAX BASIC or DEC BASIC Input
MAT PRINT #4, B(1), C(2,3) ; D |
DECBAS_MATPRINT 4, B,1,,DECBAS_COMMA,C,2,3,DECBAS_SEMI ,D |
The VAX BASIC or DEC BASIC MAT READ statement assigns values from DATA statements to array elements.
See the DATA statement for more information. The DECBAS_MATREAD support routine uses the Variant type as a way to pass arrays into the functions. Although the Translator performs a clean translation, note that Visual Basic does not support arrays of fixed-length strings or user-defined types as Variants and will generate a run-time error if used.
VAX BASIC or DEC BASIC Input
MAT READ A,B(3,3) |
DECBAS_MATREAD DECBAS_DATA,DECBAS_DATA_INDEX, A(),,,B(),3,3 |
The VAX BASIC or DEC BASIC MAX function compares the values of two or more numeric expressions and returns the highest value.
If you specify values with different data types, the Translator performs data type conversions necessary to maintain precision. The Translator returns a function result whose data type is compatible with the values that you supply. For more discussion of data types, see Chapter 4.
In VAX BASIC or DEC BASIC, MID$ can be used either as a statement or as a function. The MID$ statement performs substring insertion into a string. The MID$ function extracts a specified substring from a string expression.
The Translator actually produces code with the dollar sign ($) retained; however, functionally the code is the equivalent of the Visual Basic function Mid. Visual Basic supports both the function and statement forms. The statement form of MID is identical in VAX BASIC or DEC BASIC and Visual Basic. Multiple assignment targets are not supported. If the source is coded for multiple assignment targets, the Translator gives the following error message: NOMULTASN multiple assignment targets are not supported
The VAX BASIC or DEC BASIC MIN function compares the values of two or more numeric expressions and returns the smallest value.
If you specify values with different data types, the Translator performs data type conversions to maintain precision. The Translator returns a function result whose data type is compatible with the values that you supply. For more information on data type conversion, see Chapter 4.
The VAX BASIC or DEC BASIC MOD function divides a numeric value by another numeric value and returns the remainder.
The VAX BASIC or DEC BASIC MOD function is converted to the Visual Basic Mod operator.
VAX BASIC or DEC BASIC Input
A = MOD(B,C) |
A=(B)MOD(C) |
The VAX BASIC or DEC BASIC MOVE statement transfers data between a record buffer and a list of variables.
DECBAS_MOVEFROM channel, move_type, ...
DECBAS_MOVETO and DECBAS_MOVEFROM can correctly handle an array variable that has three or fewer dimensions. Arrays of four or more dimensions are not correctly handled.
VAX BASIC or DEC BASIC Input
MOVE TO #9, FILL$ = 10%, A = 10%, B = 30%, C = 2% |
DECBAS_MOVETO 9,DECBAS_MOVE_FILL,VBSTRING,,10, _ DECBAS_MOVE_VARIABLE,A,,10,DECBAS_MOVE_VARIABLE,B,,30, _ DECBAS_MOVE_VARIABLE,C,,2 |
MOVE FROM #1, I, A = J |
DECBAS_MOVEFROM 1,DECBAS_MOVE_VARIABLE,I,,,DECBAS_MOVE_VARIABLE,A,,J |
The VAX BASIC or DEC BASIC NAME...AS statement renames the specified file.
The VAX BASIC or DEC BASIC NEXT statement marks the end of a FOR, UNTIL, or WHILE loop.
If the NEXT is at the end of a VAX BASIC or DEC BASIC WHILE or FOR...WHILE statement, the NEXT is converted to a Visual Basic Wend statement.
The VAX BASIC or DEC BASIC NOECHO function disables echoing of input on a terminal.
VAX BASIC or DEC BASIC Input
Y = NOECHO(0%) |
Y=DECBAS_NOECHO(0) |
The VAX BASIC or DEC BASIC NOMARGIN statement removes the right margin limit set with the MARGIN statement for a terminal or a terminal-format file.
VAX BASIC or DEC BASIC Input
NOMARGIN #1 |
DECBAS_NOMARGIN 1 |
The VAX BASIC or DEC BASIC NUM function returns the row number of the last data element transferred into an array by a MAT I/O statement.
VAX BASIC or DEC BASIC Input
NUMROWS = NUM |
NUMROWS=DECBAS_MATNUM |
The VAX BASIC or DEC BASIC NUM2 function returns the column number of the last data element transferred into an array by a MAT I/O statement.
VAX BASIC or DEC BASIC Input
NUMCOLS = NUM2 |
NUMCOLS=DECBAS_MATNUM2 |
The VAX BASIC or DEC BASIC NUM$ function evaluates a numeric expression and returns a string of characters in PRINT statement format with leading and trailing spaces.
VAX BASIC or DEC BASIC Input
NUMB$ = NUM$(34.5500/31.8) |
NUMB_$=DECBAS_NUM$(34.5500/31.8) |
The VAX BASIC or DEC BASIC NUM1$ function changes a numeric expression to a numeric character string without leading and trailing spaces and without rounding.
VAX BASIC or DEC BASIC Input
numb1$ = NUM1$(PI/2) |
numb1_$=DECBAS_NUM1$(3.141592653589793238462643383279502/2) |
Under certain conditions, a VAX BASIC or DEC BASIC ON ERROR GO BACK statement executed in a subprogram or DEF function transfers control to the calling program.
Use caution when dealing with explicit VAX BASIC or DEC BASIC error codes because they can differ from those in Visual Basic. The Translator attempts to map between VAX BASIC or DEC BASIC and Visual Basic error codes, but the OpenVMS and Visual Basic error handling schemes differ in many subtle ways. It is important that you check and test each usage of error codes. For more information on the translation of exception handling statements, see Chapter 6.
VAX BASIC or DEC BASIC Input
ON ERROR GO BACK |
ON ERROR GOTO 0 |
The VAX BASIC or DEC BASIC ON ERROR GOTO statement transfers program control to a specified line or label in the current program unit when an error occurs under certain conditions.
Use caution when dealing with explicit VAX BASIC or DEC BASIC error codes because they can differ from those in Visual Basic. The Translator attempts to map between VAX BASIC or DEC BASIC and Visual Basic error codes, but the OpenVMS and Visual Basic error handling schemes differ in many subtle ways. It is important that you check and test each usage of error codes. For more information, see Chapter 6.
VAX BASIC or DEC BASIC Input
ON ERROR GOTO 10 |
ON ERROR GOTO 10 |
The VAX BASIC or DEC BASIC ON ERROR GOTO 0 statement disables ON ERROR error handling and passes control to the VAX BASIC or DEC BASIC error handler when an error occurs.
Use caution when dealing with explicit VAX BASIC or DEC BASIC error codes because they can differ from those in Visual Basic. The Translator attempts to map between VAX BASIC or DEC BASIC and Visual Basic error codes, but the OpenVMS and Visual Basic error handling schemes differ in many subtle ways. It is important that you check and test each usage of error codes. For more information on the translation of exception handling statements, see Chapter 6.
VAX BASIC or DEC BASIC Input
ON ERROR GOTO 0 |
ON ERROR GOTO 0 |
The VAX BASIC or DEC BASIC ON...GOSUB statement transfers program control to one of several subroutines, depending on the value of a control expression.
Without Optional OTHERWISE Clause
DECBAS_TEMP = exp IF (DECBAS_TEMP < 1) OR (DECBAS_TEMP > n) THEN Err.Raise 5 ON DECBAS_TEMP GOSUB t1, t2, ... tn |
With Optional OTHERWISE Clause
DECBAS_TEMP = exp IF (DECBAS_TEMP < 1) OR (DECBAS_TEMP > n) THEN GOSUB tx ON DECBAS_TEMP GOSUB t1, t2, ... tn |
VAX BASIC or DEC BASIC and Visual Basic accept both the ON...GO SUB statement and the ON...GOSUB statement, but the Translator always generates an ON...GOSUB equivalent. Visual Basic has a limit of 255 destinations; VAX BASIC or DEC BASIC has no limit. If more than 255 destinations are given, the Translator issues a warning message.
VAX BASIC or DEC BASIC Input
ON 3 GOSUB l1, l2 OTHERWISE l3 |
DECBAS_TEMP=3 IF(DECBAS_TEMP<1)OR(DECBAS_TEMP>2)THEN GOSUB l3 END IF ON DECBAS_TEMP GOSUB l1,l2 |
The VAX BASIC or DEC BASIC ON...GOTO statement transfers program control to one of several lines or targets, depending on the value of a control expression.
Without Optional OTHERWISE Clause
DECBAS_TEMP = exp IF (DECBAS_TEMP < 1) OR (DECBAS_TEMP> n) THEN Err.Raise 5 ON DECBAS_TEMP GOTO t1, t2, ... tn |
With Optional OTHERWISE Clause
DECBAS_TEMP = exp IF (DECBAS_TEMP < 1) OR (DECBAS_TEMP > n) THEN GOTO tx ON DECBAS_TEMP GOTO t1, t2, ... tn |
VAX BASIC or DEC BASIC and Visual Basic accept both the ON...GO TO statement and the ON...GOTO statement, but the Translator always generates an ON...GOTO equivalent. Visual Basic has a limit of 255 destinations; VAX BASIC or DEC BASIC has no limit. If more than 255 destinations are given, the Translator issues a warning message.
VAX BASIC or DEC BASIC Input
ON 2 GOTO l1, l2 |
DECBAS_TEMP=2 IF(DECBAS_TEMP<1)OR(DECBAS_TEMP>2)THEN ERR.RAISE 5 END IF ON DECBAS_TEMP GOTO l1,l2 |
Previous | Next | Contents | Index |