hat & gloves

Home PageM |  FileMan | Kernel | CS/MM/Web | Programmer Tools | Applications

In the course of upgrading the utility routines for Micronetics Standard MUMPS (MSM), version 4.4, the need for an improved version of the utility program ^%INDEX was recognized.

Through the FOIA process, and the kind help of Greg Kreis, a copy of the current version of the VISTA %INDEX software was obtained. (Note from grk: VISTA moved the %INDEX routines into the XIND* namespace. It appears the author of this article has namespaced the routines in %IND* for his use. This is one of those scenarios where a routine name, %INDEX, has been adopted as the product name even after it has been re-namespaced.)

The DVA's (VISTA) software, of course, relies on the services of the Kernel software to support the various utility routines. In order to make ^%INDEX work as a "stand-alone" utility program in MSM, a minor number of modifications was needed to make ^%INDEX work without the support of the Kernel routines.

The text below explains which modifications were made to "customize" the ^%INDEX software for use as a "stand-alone" utility. From the limited list of modifications, it becomes once again clear how important it is to isolate platform-specific code in a small number of subroutines: because the DVA's software follows this premise, the process of "customizing" the software was a simple and very straightforward task.

Ed de Moel
December 1997

The modifications

  1. Calls to ^%ZIS were replaced by new subroutines added to ^%INDEX as follows:
  2. Calls to NOW^%DTC were replaced by a new subroutine added to ^%INDEX as follows:
  3. Calls to DD^%DT were replaced by a new subroutine added to ^%INDEX as follows:
  4. References to global variable ^%ZOSF were replaced as follows:

With these modifications, the indexer ran on an MSM system without producing any errors.

Additional Capabilities

In order to provide additional (MSM-specific) capabilities, the following modifications were made:

  1. Add names of implementation-specific entities to the lists in ^%INDX6
  2. Make ^%INDX9 recognize names of svns, functions and ssvns when spelled in lower case
  3. Add a question to suppress SACC warnings.
  4. Make ^%INDX8 recognize names of commands when spelled in lower case
  5. Make ^%INDX8 recognize names of ssvns
  6. Make ANS^%INDX6 recognize lower case input for all questions
  7. Make ^%INDX2 recognize lower case in names of global and local variables
  8. Make ^%INDX8 recognize library functions ($%) and external functions ($&):

Further Corrections

In the process of looking at the software, a couple of minor glitches were discovered:

  1. In ^%INDX7, the name of ^$WINDOW was spelled XINDOW
  2. In ^%INDX8, the compound goto command just before label GRB is sensitive to changes in the value of local variable X. Changing this line to:
    has the effect that at most one of the possible destinations will be executed, even if the value of local variable X changes in one of these subroutines.


 k IO
 s IOM=80 ; Right margin
 s IOSL=50 ; Page length
 s IOF="#" ; Form feed _format_
 s IO(0)=$p


 u %DEV s IO=%DEV
 s IOM=80 ; Right margin
 s IOSL=50 ; Page length
 s IOST="" ; 
 s ION="" ; 
 s IOF="#" ; Form feed _format_
 s IOP="" ; 
 s IO(0)=$p






NOW S %=$ZHL(1,"yyyymmdd",$H)-17000000_"."_$ZHL(2,"HHmmss",$P($H,",",2)) q


DDDT n d,t
 s d=Y\1#100_"-"_$p("JAN FEB MAR APR MAY JUN JUL AUG SEP OCT NOV DEC"," ",Y\100#100)_"-"_(Y\10000+1700),t=""
 S:Y["." t=$P(Y,".",2)_"0000",t=$e(t,1,2)_":"_$e(t,3,4)
 S:$g(%DT)["S" t=$P(Y,".",2)_"000000",t=$e(t,1,2)_":"_$e(t,3,4)_":"_$e(t,5,6)
 S Y=d s:t'="" Y=Y_", "_t


UCASE(X) Q $TR(X,"abcdefghijklmnopqrstuvwxyz","ABCDEFGHIJKLMNOPQRSTUVWXYZ")

Search | Home | MUMPS | Fileman | Kernel | C/S, Mailman, Web | Programmer Tools | Applications