|
|||||||
QTIPS - Replacing GAS.BAR routine during PERFORM "SELECT"Mike Pope of Revelation Technologies (UK) Ltd in conjunction with David Kralman of the Seattle RUG has contributed one of those earth-shattering tips that have you kicking yourself asking why you never saw it. For those who have not seen this tip before :- In one of our applications we have disabled the status line completely and use our own routine to provide bottom screen line help. This works perfectly when called as a preprompt from Window, or from within our menu driver, however it does not cater for the "Gas Bar" display used when performing a select. Previously it had been necessary to display a "Please Wait" message and then just perform the select. A routine had already been developed (DISPLAY_PROGRESS) which working off a record count in labelled common and @RN.Counter, graphically plotted the progress of a Readnext loop on screen. DISPLAY_PROGRESS has three call types, @RN.Counter = 0, initialise; @RN.Counter = Record Count, tidy up screen; Otherwise, update display. What was needed was a way to call the initialise and the update from within the PERFORM "SELECT" - the tidy up would be done automatically when @RN.Counter reached @Rec.Count. The solution was elegant simplicity. Simply create a symbolic on the dict of Voc called GAS_BAR which has code similar to the following pseudo code 0001 If @SENTENCE # "Done" Then 0002 Get Reccount for file 0003 Initialise @RN.Counter to 0 0004 Call custom gas bar passing rec.count 0005 Set @SENTENCE to "Done" 0006 End Else 0007 Call custom gas bar 0008 End 0009 @ANS = 1 and then PERFORM "SELECT FILE BY FIELD WITH GAS_BAR AND WITH REST_OF_CRITERIA". The position of WITH GAS_BAR is irrelevant as it still gets processed regardless of whether other WITHs fail. (Worth bearing in mind if you are selecting on two complex symbolics, it might be worth selecting with one, and then selecting on the resolved list with the other so as not to evaluate both symbolics for all records). (Volume 3, Issue 8, Page 10) |
|||||||
| |||||||