Does anyone remember how to flush indexes in REVG2B within an Rbasic program–I know there was a way but it was a long time ago.
FLUSH - clears out any groups not currently being accessed
GARBAGECOLLECT - recovers unused string space
The GARBAGECOLLECT statement should be used after a FLUSH. It is a good practise to use these statements prior to a MATREAD and after a MATWRITE.
Thanks for the info but FLUSH and GARBAGE collect do not do what I need. The problem is that XREF indexes were created created through an RDES SCR and update correctly when the screen is used, but I need to do some RBASIC processing on the file outside of the screen. My RBASIC WRITEs to the data file do not seem to update the .XREF file. Any suggestions on how to force the .XREF file to update?
Hauled out my Rev Revealed
The Appendix mentions a utilities disk program called invert.all, including source. That's probably the place to start
Hope this helps
Bob
The indexes do not automatically update because there is no connection outside of an interpreted or compiled screen. Have you tried creating source code for the Rdes screen?
To create source for an Rdes screen use the command GEN. Then examine the source code to see how the indexer (V44) is called using.
Rev G2B does not have MFSes as Advanced Revelation does and indexing updates are done only at the record write time in RDesign screens.
The utility INVERT.ALL can be used to rebuild indexes.
If you wish to incorporated indexing to an RBasic program you should clone the indexing code from the PROMPTER subroutine that RDesign uses.
Both INVERT.ALL and PROMPTER source code are provided on the G2B utilities disk.
Actually there is a system subroutine V44 RDesign calls, the source for this is also included on the Utility disk.
CALL V44(MODE,XREF.KEY,PROMPT,PROGRAM,DATA.IO)
Where
Mode A adds all references contained in DATA.IO
Mode D deletes all references contained in DATA.IO
Mode R removes all references for major file record XREF.KEY
Mode U adds only references that are in DATA.IO but not in the
current record and deletes references that are in the recordbut not in DATA.IOModes U and R are more efficient.
XREF.KEY=(see above)
PROMPT=(field name of RDesign prompt being inverted) defined in RDES file in records XR*majorfilename*prompt and the DICT of majorfile
PROGRAM=(name of RDesign screen saved in RDES) majorfilename is extracted from this record (file being inverted).
DATA.IO=data to be inverted, may contain delimiters as defined in the RDesign screen.
It looks like V44 will do what I need. Thank you all very much for your help.