Published By | Date | Version | Knowledge Level | Keywords |
---|---|---|---|---|
Sprezzatura Ltd | 01 AUG 1990 | 2.0+ | EXPERT | INDEX.SUB, MAKE.INDEX, XREF, REBUILD, INDEXING, @PSEUDO, @SENTENCE |
One of the most popular articles in Volume 1 of REVMEDIA was that explaining the use of the undocumented routine MAKE.INDEX to manipulate indexes on files. The first utility diskette contained a routine called INDEX.SUB which used MAKE.INDEX and INDEXING to simplify all handling of indexes.
With the release of 2.0, RevTech have changed the way in which both of these routines work. This article reflects these changes and explains how to modify the INDEX.SUB code to cope with the new release.
Whilst the old "A" call to add XREF indexes seems to work, an index rebuild does not work on an XREF index created in this manner. This is because RevTech have rationalised the way in which the system treats symbolic btrees. Whereas previously the .XREF dictionary item did not require a flag in field six indicating that it was btreed, version 2.0 insists that this be present. Thus the MAKE.XREF.DICT portion of INDEX.SUB must be modified to take account of this as follows.
MAKE.XREF.DICT: DICT.REC = "S" DICT.REC<3> = ITEM : ".XREF" DICT.REC<4> = "M" DICT REF<6> = 1 <---------- NEW!! DICT.REF<8> = "CALL XREF(.............. (as before) DICT.REF<9> - "L" : @FM : 10 RETURN
The INDEXING subroutine has been modified so that it looks for its input in @PSEUDO rather than in @SENTENCE. The structure of @PSEUDO must be
@PSEUDO<1>= FILENAME @PSEUDO<2>= ITEMNAME @PSEUDO<3>= B for BTREE C for Cross Reference R for Relational
The relevant sections of INDEX.SUB should be modified as follows
CASE ACTION = "B" *Rebuild a btree @PSEUDO = FILE : @FM : ITEM : @FM : "B"
OR
*Rebuild an XREF @PSEUDO = FILE : @FM : ITEM : @FM : "C"
OR
*Rebuild a relational @PSEUDO = FILE : @FM : ITEM : @FM : "R" CALL INDEXING ("TCL")
(Volume 2, Issue 4, Page 4)