Previous | Contents | Index |
The VAX BASIC or DEC BASIC RECORD statement lets you name and define data structures in a program. It also provides the VAX BASIC or DEC BASIC interface to the Oracle CDD/Repository. You can use the defined RECORD name anywhere a VAX BASIC or DEC BASIC data type keyword is valid if all data types are valid in that context.
The Translator does not support extracting record definitions from the CDD/Repository. The definitions must be extracted manually. For more information, see Section 4.2.7.
The VAX BASIC or DEC BASIC RECOUNT function returns the number of characters transferred by the last input operation.
VAX BASIC or DEC BASIC Input
character_count = RECOUNT |
character_count=DECBAS_RECOUNT() |
The VAX BASIC or DEC BASIC REM statement allows you to document your program.
For more information and an example, see Section 3.3.
The VAX BASIC or DEC BASIC REMAP statement defines or redefines the position in the storage area of variables named in the MAP DYNAMIC statement.
The Translator does not support conversion of the VAX BASIC or DEC BASIC REMAP statement.
The VAX BASIC or DEC BASIC RESET statement is a synonym for the RESTORE statement. See the RESTORE statement for more information.
RESET File
DECBAS_RESTORE_KEY [[CHANNEL := channel [,KEY
:= int-exp]]
RESET Data
DECBAS_DATA_INDEX=0
The VAX BASIC or DEC BASIC RESET and RESTORE statements are synonyms.
VAX BASIC or DEC BASIC Input (RESET Key)
RESET #7, KEY #4 |
DECBAS_RESTORE_KEY CHANNEL:= 7,KEY_NUMBER:= 4 |
The VAX BASIC or DEC BASIC RESTORE statement resets the DATA pointer to the beginning of the DATA sequence or sets the record pointer to the first record in a file.
RESTORE File
DECBAS_RESTORE_KEY [[CHANNEL := channel [,KEY
:= int-exp]]
RESTORE Data
DECBAS_DATA_INDEX=0
VAX BASIC or DEC BASIC Input (RESTORE Data)
RESTORE |
DECBAS_DATA_INDEX = 0 |
The VAX BASIC or DEC BASIC RESUME statement marks an exit point from an ON ERROR error-handling routine. VAX BASIC or DEC BASIC clears the error condition and returns program control to a specified line number, label, or to the program block in which the error occurred.
Resume label
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, in particular for the translation of RESUME to Resume Next. For more information, see Chapter 6.
VAX BASIC or DEC BASIC Input
RESUME |
RESUME NEXT |
The VAX BASIC or DEC BASIC RETRY statement clears an error condition and reexecutes the statement that caused the error inside a protected region of a WHEN block.
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
RETRY |
RESUME |
The VAX BASIC or DEC BASIC RETURN statement transfers control to the statement immediately following the most recently executed GOSUB or ON...GOSUB statement in the current program unit.
The VAX BASIC or DEC BASIC RIGHT$ function extracts a substring from a string's right side, leaving the string unchanged.
There is no equivalent in Visual Basic for the VAX BASIC or DEC BASIC RIGHT$ function. The Visual Basic Right function would extract a different substring. (VAX BASIC or DEC BASIC treats the numeric argument as an offset from the beginning of the source string and returns a string from that point to the end. The Visual Basic Right function treats the numeric argument as the number of characters to return from the end of the string.)
VAX BASIC or DEC BASIC Input
s = RIGHT$("1234567", 3) |
s=DECBAS_RIGHT$("1234567",3) |
"34567" |
The VAX BASIC or DEC BASIC RMSSTATUS function returns the RMS status or the status value of the last I/O operation on a specified open I/O channel.
The Translator does not support conversion of the VAX BASIC or DEC BASIC RMSSTATUS function.
The VAX BASIC or DEC BASIC RND function returns a random number greater than or equal to zero and less than 1.
VAX BASIC or DEC BASIC and Visual Basic do not use identical internal algorithms to generate the random value. The translated program produces random values but might not produce the same sequence of random values as the VAX BASIC or DEC BASIC source program.
VAX BASIC or DEC BASIC Input
x = RND |
x=RND |
The VAX BASIC or DEC BASIC RSET statement assigns right-justified data to a string variable. RSET does not change a string variable's length.
The VAX BASIC or DEC BASIC LSET statement allows multitarget assignment, while the Visual Basic statement allows only one. The Translator includes partial support for multitarget assignments. See the LET statement for a description and examples. VAX BASIC or DEC BASIC and Visual Basic semantics differ. When the source string is longer than the destination string, the operation of VAX BASIC or DEC BASIC RSET and the operation of Visual Basic RSet differ. If n is the length of the destination string, then VAX BASIC or DEC BASIC uses the n rightmost characters of the source string. Visual Basic uses the n leftmost characters of the source string.
VAX BASIC or DEC BASIC Input
s = "ABCDE" RSET s = "1234567" |
s="ABCDE" RSET s="1234567" |
s is 34567 |
s is 12345 |
The VAX BASIC or DEC BASIC SCRATCH statement deletes the current record and all following records in a sequential file.
Visual Basic does not have a corresponding function. DECBAS_SCRATCH, therefore, simulates a deletion on a local sequential file by overwriting the record and all following records with NUL characters. In VAX BASIC or DEC BASIC, if you deleted Record No. 10 with the SCRATCH statement and later tried to access Record No. 10, a Record Not Found error would be issued. By contrast, in Visual Basic, Record No. 10 would still exist, but would contain only NUL characters.
VAX BASIC or DEC BASIC Input
SCRATCH #4% |
DECBAS_SCRATCH 4 |
The VAX BASIC or DEC BASIC SEG$ function extracts a substring from a main string, leaving the original string unchanged.
VAX BASIC or DEC BASIC Input
string1$ = SEG$ (OrigString$,4,7) |
string1$=DECBAS_SEG$(OrigString$,4,7) |
The VAX BASIC or DEC BASIC SELECT statement lets you specify an expression, a number of possible values that the expression can have, and a number of alternative statement blocks to be executed for each possible case.
VAX BASIC or DEC BASIC Input
SELECT A% + B% + C% CASE = 100 PRINT 'THE VALUE IS EXACTLY 100' CASE 1 TO 99 PRINT 'THE VALUE IS BETWEEN 1 AND 99' CASE > 100 PRINT 'THE VALUE IS GREATER THAN 100' CASE ELSE PRINT 'THE VALUE IS LESS THAN 1' END SELECT |
SELECT CASE A__% + B__% + C__% CASE = 100 PRINT 'THE VALUE IS EXACTLY 100' CASE 1 TO 99 PRINT 'THE VALUE IS BETWEEN 1 AND 99' CASE > 100 PRINT 'THE VALUE IS GREATER THAN 100' CASE ELSE PRINT 'THE VALUE IS LESS THAN 1' END SELECT |
The VAX BASIC or DEC BASIC SET PROMPT statement enables a question mark prompt to appear after the compiler executes either an INPUT, LINPUT, INPUT LINE, MAT INPUT, or MAT LINPUT statement on channel #0. The SET NO PROMPT statement disables the question mark prompt.
VAX BASIC or DEC BASIC Input
SET NO PROMPT |
DECBAS_SETNOPROMPT |
The VAX BASIC or DEC BASIC SGN function determines whether a numeric expression is positive, negative, or zero. It returns 1 if the expression is positive, --1 if the expression is negative, and zero if the expression is zero.
The VAX BASIC or DEC BASIC SIN function returns the sine of an angle in radians or degrees.
The VAX BASIC or DEC BASIC SLEEP statement suspends program execution for a specified number of seconds or until the return key is pressed from the controlling terminal.
VAX BASIC or DEC BASIC Input
SLEEP 20 |
DECBAS_SLEEP 20 |
The VAX BASIC or DEC BASIC SPACE$ function creates a string containing a specified number of spaces.
The Translator actually produces code with the dollar sign ($) retained; however, functionally the code is the equivalent of the Visual Basic function Space.
The VAX BASIC or DEC BASIC SQR (SQRT) function returns the square root of a positive number.
The VAX BASIC or DEC BASIC STATUS function returns an integer value containing information about the last opened channel. Your program can test each bit to determine the status of the channel.
The Translator does not support conversion of the VAX BASIC or DEC BASIC STATUS function.
The VAX BASIC or DEC BASIC STOP statement halts program execution allowing you to optionally continue execution.
The VAX BASIC or DEC BASIC STR$ function changes a numeric expression to a numeric character string without leading and trailing spaces.
The VAX BASIC or DEC BASIC STRING$ function creates a string containing a specified number of identical characters.
The Translator actually produces code with the dollar sign ($) retained; however, functionally the code is the equivalent of the Visual Basic function String.
The VAX BASIC or DEC BASIC SUB statement marks the beginning of a subprogram and specifies the number and data type of its parameters.
Data type declarations in the parameter list are changed as appropriate. The other words are reordered as follows:
SUB sub-name [pass-mech] [( [formal-param],... )] |
SUB sub-name [( [vb-formal-param],... )] |
Any default passing mechanism is made explicit by the Translator for each parameter. Each formal-param is translated as follows:
[data-type] var-name [( [int-const],... )] [= str-len] [pass-mech] |
vb-pass-mech var-name [()] [AS vb_data_type] |
Any int-const array sizes are omitted, as are any str-len declarations of string lengths. Visual Basic does not need these because it passes enough information with array and string parameters to determine the sizes at run time, even when parameters are passed by reference. Visual Basic does not implement descriptors as such, so parameters cannot be passed BY DESC. These parameters are translated to pass BY REF, so that the called routine can modify the caller's copy of the value(s). You may wish to modify this behavior.
Previous | Next | Contents | Index |