While developing an app using OpenInsight for MV (in this case Universe) from Revelation Software Bob Carten at Revelation suggested using commuter modules to manage I Descriptors that use the SUBR call. (Note that this approach can be used without Revelation - it just happens to be my first use-case). To establish a convention, each MV table that uses a commuter has a subroutine in the program file that starts with "I_" for I Descriptor. That way you can see all of these commuters grouped together when listing them. In this example, the MV Table in Universe is called "BOOKABLE", so the commuter subroutine is named "I_BOOKABLE" and in this example we will be using the dictionary entry "DESCRIPTION" and these are the first 5 lines of that DICT:
>ED DICT BOOKABLE DESCRIPTION
This is a Type "I" Descriptor last compi
20 lines long.
----: L5
0001: I
0002: SUBR("I_BOOKABLE","DESCRIPTION")
0003:
0004:
0005: 20L
And this is the subroutine I_BOOKABLE
SUBROUTINE I_BOOKABLE(RESULT,DICT_ID)
*
*******************************************************************************
*
* PROGRAMS I_BOOKABLE
*
* Copyright (C) 2024
*
*
*******************************************************************************
*
* Author: Karl Pozmann
* Created on: Dec 20, 2024 1:56:46 PM
* Description: Commuter module to manage I Descriptor SUBR calls in BOOKABLE
* Example: SUBR("I_BOOKABLE","DESCRIPTION") where DESCRIPTION is in
* DICT BOOKABLE
*
*
*****************************************************************************
*
BEGIN CASE
CASE DICT_ID = "DESCRIPTION"
GOSUB THISDESCRIPTION
CASE 1
RESULT = "UNDEFINED SUBR I DESCRIPTOR"
END CASE
RETURN
*
THISDESCRIPTION: * IDEAL FLAVOR DOESN'T LIKE NON-ALHPANUMERICS
THIS.ITEM_NUMBER = FIELD(@ID,"*",1)
RESULT = OCONV(THIS.ITEM_NUMBER,'TITEM_DESP_SERVER;X;1;1')
RETURN
END
To add a new dictionary, simply insert an appropriate CASE statement along with its internal subroutine, or use external sub calls.
This same approach can be used for Screens/Windows as well, where one subroutine manages all of the code for a window/screen
------------------------------
Karl Pozmann
Akron, OH
------------------------------