MultiValue Compatibility

This topic describes English features that are provided only for compatibility with other MultiValue systems.

B Conversion Code - Call Subroutine

The B conversion code provides similar functionality to the CALL conversion code. It is provided for compatibility with mvBase and mvEnterprise systems and allows dictionary subroutines written for these systems to be called from File and Data Definition items on Reality.

Syntax

B;subroutine

Syntax Elements

subroutine The name of a DataBasic subroutine, cataloged in the current account.

Notes

  • The subroutine's catalog entry must be in the current account. You cannot specify a different account.
  • Unlike the CALL conversion code, B does not accept a following parameter string.

Features of a B Conversion Code Subroutine

A B conversion code subroutine must have no parameters and must INCLUDE the item #ACCESS.COMMON from the file /SYSFILES/SYS.BASLIB. For example:

SUBROUTINE MAX1
 INCLUDE /SYSFILES/SYS.BASLIB #ACCESS.COMMON

You should add the INCLUDE statement to dictionary subroutines imported from mvBase and mvEnterprise systems. The following symbols and common variables will then be available:

mvEnterprise mvBase Reality Equivalent Description
C.PRMFILE FILE$ ACCESS(1) A reference to the calling file.
C.DICTPRIMFILE DICT$ ACCESS(2) If the calling file is a data section, a reference to the dictionary of the calling file. If the calling file is a dictionary, a reference to the calling file.
C.ITEM ITEM$ ACCESS(3) The item body. Null if a delete operation.
Not used NI$ ACCESS(4) Item count.
C.AMC NA$ ACCESS(5) Attribute count.
C.VMC NV$ ACCESS(6) Value Count.
C.SVMC NS$ ACCESS(7) Subvalue Count.
C.FLAGS ND$ ACCESS(8) Detail Count.
Not used NB$ ACCESS(9) Break count.
C.ITEMID ID$ ACCESS(10) The id of the item.
C.PRIMFILENAME FILENAME$ ACCESS(11) The file name in the form {DICT} {/account/}filename{,data-section-name}.
C.DATA CURRENT$   The value passed to the subroutine.
Not used MAX$   The current column width as defined in the Data Definition item.
C.USER(15) Not used   User data.

Example

This returns the highest numeric value in the values and subvalues of the first attribute of the item. It would be called using the B conversion code in attribute 7 of a File Definition item or in attribute 7 or 8 of a Data Definition item.

SUBROUTINE BMAX
 *
 * B type (mvEnterprise version)
 *
 INCLUDE /SYSFILES/SYS.BASLIB #ACCESS.COMMON
 *
 * C.ITEM = file item
 *
 C.DATA = MAXIMUM(C.ITEM<1>)
RETURN

Division using A and F Conversion Codes

The division (/) operations provided by the A and F conversion codes normally return the dividend if division by zero is attempted. If required, this can be be changed to return zero by setting the ENGDIVIDE option in your operating environment.

Date Format

The DD, DM and DAM conversion codes normally return the day or month (as appropriate) without any leading zero. If required, this can be changed to include a leading zero, if appropriate, by setting the 2DIGIT.DATE option in your operating environment.

Changing Case

The MCT conversion code normally treats the first alphanumeric character following a space, double quotation mark, left parenthesis or hyphen as the start of a word. If you set the MCT.SQUOTE option in your operating environment, however, a word starts with the first alphanumeric character following any non-alphanumeric character other than a single quote.

Go to top button