Form.List.S
QTIPS - Aesthetically Improving RLIST Reports
QTIPS - Form Processor
QTIPS - Suppressing Initial Form Feed
QTIPS - Using RTP29 In Place of V6
RTP Series - RTP27
QTIPS - Printing Large Variables from the Debugger
VERBatim - V87
Version 2
Directory Exists on Novell
Gas Bar
Prompt Help
DOS Interfacing (Part II)
@ATTACK - @Help.Level
@ATTACK - @StatList
QTIPS - Standardising Error Message Display
Video Control
Customising the Status Line
QTIPS - Command Line Options
Customising the Status Line
VERBatim - V17
VERBatim - V6
VERBatim - V125
Utility Diskette # 3 - Part I
Version 3 Technical Highlights - Copying Rows Programmatically
Version 3 TCL Subroutines - Copying Rows
Playing with Scan Codes
QTIPS - Compiling Protection Code
QTIPS - Invalid Code and Command
QTIPS - Code/Command Help
Compiling 64K on a Shoestring by Blaise Wrenn (LexStat Systems Ltd)
Reader's Clinic - Page Marks in Windows
Utility Diskette # 3 - Part I
QTIPS - Finding/Replacing Spaces With The Editor
Utility Diskette # 4
@ATTACK - @Modal
Gas Bar
@ATTACK - @Rec.Count
QTIPS - Replacing GAS.BAR routine during PERFORM "SELECT"
A RevTI Techie Replies - Mike Pope - Revelation Technologies (UK) Ltd
Gas Bar
VERBatim - V9
@ATTACK - @Rec.Count
QTIPS - Replacing GAS.BAR routine during PERFORM "SELECT"
A RevTI Techie Replies - Mike Pope - Revelation Technologies (UK) Ltd
Background Processing
Vroom - Window Processing
VROOM - Window Processing II
Reader's Clinic - Incorrect Indexes
Vroom
RTP Series - RTP20
RTP Series - RTP12
Form.List.S
VERBatim - V5
@ATTACK - @Last.Select.Process
@ATTACK - @Save.Select
QTIPS - File Variable of File In SELECT Statement
QUERY.SUB
REVMEDIA Revisited
QTIPS - Extended Select Syntax
Spindex - A Review
Spindex vs BondTRV
REVMEDIA Revisited
QTIPS - Replacing GAS.BAR routine during PERFORM "SELECT"
QTIPS - Extended Select BY
QTIPS - EasyWriter
QTIPS - MFS - Select.Index
Form.List.S
Make.Index
Index Sub Revisited
QTIPS - Make.Index 2.11+
QUERY.SUB
Version 3 Technical Highlights - Creating New Accounts Programmatically
Version 3 TCL Subroutines - Creating New Accounts
Version 3 TCL Subroutines - Creating Tables
VERBatim - V47
VERBatim - V15
QTIPS - Compiling Work around on runtimes
Reader's Clinic - EVAL
QTIPS - Compiling Protection Code
RTP5 and RTP51
Compiling 64K on a Shoestring by Blaise Wrenn (LexStat Systems Ltd)
Reader's Clinic - Functions and Subroutines
Argument passing - Subroutines and Functions - Mike Pope
RTP Series - RTP11
RTP Series - RTP43
@ATTACK - @Rn.Counter
Vroom
QTIPS - Replacing GAS.BAR routine during PERFORM "SELECT"
QTIPS - Extended Select BY
QTIPS - PERFORM Arguments and FMT Specifications
What's New (and un(der)documented!) In 2.12
RTP Series - RTP42
VERBatim - V65
Argument passing - Subroutines and Functions - Mike Pope
QTIPS - Using @Upper.Case and @Lower.Case with Foreign Languages
@ATTACK - @Lower.Case
@ATTACK - @Upper.Case
Sorting out Collation Sequences by Mike Pope
Reader's Clinic - Different Id Same Record
RTP Series - RTP25
QTIPS - String Space
Reader's Letters - Jim Owen
QTIPS - Finding/Replacing Spaces With The Editor
Gas Bar
@ATTACK - @Rn.Counter
QTIPS - Replacing GAS.BAR routine during PERFORM "SELECT"
QTIPS - Inconsistent @Variable Behaviour
Merge Processor
Utility Diskette # 4
@ATTACK - @Reduction.Done
QTIPS - DOSTime
VERBatim - V11
@ATTACK - @Backgrnd.Time
@ATTACK - @Index.Time
QTIPS - Time-outs in Windows
Vroom
Vroom - Window Processing
Reader's Forum
VROOM - Doubling MFS Write Speed
Utility Diskette # 3 - Part II
Reader's Clinic - Slow Multivalued Screen Display
RTP Series - RTP42
RTP Series - RTP51
Reader's Clinic - AREV Runtime
@ATTACK - @PDisk.On
Advanced Revelation Initialisation Sequence (Overview) by Mike Pope
AREV Comes to Czechoslovakia Les Palenik, Cosmotron Systems
Creating Your Own Background Processes
@ATTACK - @Last.Select.Process
Reader's Forum
QTIPS - Menu Item Pre-Processing

RevMedia FKB

DocumentV1I2A16
TitleGas Bar
KeywordsGAS.BAR
@REC.COUNT
STATUS.CONSTANTS
STATUP
@RN.COUNTER
TextThey say that imitation is the sincerest form of flattery so the chaps at
RevTech ought to be pleased by the following program One of the features
that I found the most visually appealing in Release 1 1 was what was
euphemistically described as the "Gasometer" on the status line when SELECTS
or SORTS were in progress (Obviously the Americans have never lived next
door to a British Gasometer) Naturally I wanted to copy this in my own
programs but got a little tired of always rewriting the same code so on the
next page please find a listing for a routine that I've called "GAS BAR"
(please call it what you will) This emulates the functionality of the AREV
gasometer but can be used FROM ANY program which sets @REC COUNT and then
loops through processing each record in the select list It would be a
simple mod to make the program accept a passed record count if @REC COUNT
was not set but I'm trying to keep all code listings to a minimum so I'll
leave that to you

To use simply enter the program compile and catalogue it Then at the top
of your program declare subroutine GAS BAR and within your READNEXT LOOP
insert the STATEMENT GAS BAR() E G

EQU TRUE$ TO 1
EQU FALSE$ TO 0
EOF = FALSE$
DECLARE SUBROUTINE GAS BAR
PERFORM "SELECT MYFILE"
LOOP
READNEXT ID ELSE EOF = TRUE$
UNTIL EOF DO
GOSUB RECORD PROCESSING
GAS BAR()
REPEAT

And so to the code dissection

0013 LABELLED Common I'm amazed at how many people don't use labelled
common It's very straightforward and well documented in the Technical
Reference Manual (q v )

0014 The EQUATE statements are used here for two reasons to improve the
readability and in this case to save space further down to prevent
lines "wrapping" which becomes misleading

0024 @RN COUNTER is automatically incremented by the READNEXT processor to
tell you how far through the select list you are It is the
responsibility of the developer to RESET this to 0/1 at the start of
a READNEXT operation

0049 This test is done to ensure that the Status line is only refreshed when
the PERCENT done has actually changed Why waste time refreshing the
status line WITH the same value?

NB This routine adds about 3 seconds to the processing of 1000 records or
about 003 seconds per record a speed sacrifice well worth it for "user
friendliness"


0001 SUBROUTINE GAS BAR
0002 *
0003 * Author AMcA
0004 * Purpose To display a "Gas Bar" on status line when
0005 * processing records to indicate progress
0006 * like in the AREV "Select" process
0007 * Copyright Sprezzatura Ltd 1989
0008 * Permission is granted for REVMEDIA
0009 * subscribers to use this program for
0010 * any purpose (At your own risk!)
0011
0012 $INSERT BP STATUS CONSTANTS
0013 COMMON/%%GAS BAR%%/LAST PERCENT SAVED STATUS
0014 EQU VERT$ TO CHAR(170)
0015 EQU BLOCK$ TO CHAR(219)
0016
0017 IF @REC COUNT THEN
0018 IF LAST PERCENT = "" THEN
0019 *
0020 * 1st time in save status line and set LAST PERCENT
0021 *
0022 STATUP(PUSH$ "" SAVED STATUS)
0023 LAST PERCENT = 0
0024 @RN COUNTER = 1
0025 GOSUB DISPLAY BAR
0026 END ELSE
0027 *
0028 * Must be in LOOP so determine display action
0029 *
0030 IF @RN COUNTER = @REC COUNT THEN
0031 *
0032 *Loop done remove display and RESET stat line
0033 *
0034 STATUP(SINGLE$ 3 SPACE(62))
0035 STATUP(POP$ "" SAVED STATUS)
0036 LAST PERCENT = "" ; SAVED STATUS = ""
0037 END ELSE
0038 GOSUB DISPLAY BAR
0039 END
0040 END
0041 END ELSE
0042 LAST PERCENT = "";SAVED STATUS =""
0043 END
0044 RETURN
0045
0046 DISPLAY BAR:
0047 RC= @REC COUNT ; * done to fit NEXT line on single line
0048 PERCENT = INT((@RN COUNTER)/RC) * 100)
0049 IF PERCENT # LAST PERCENT THEN
0050 GRAPH :="Done" : VERT$ : PERCENT "R(0)#3" : "%": VERT$
0051 GRAPH := STR(BLOCK@ INT(PERCENT/2))
0052 STATUP(SINGLE$ 3 GRAPH)
0053 LAST PERCENT = PERCENT
0054 END
0055 RETURN


(Volume 1 Issue 2 Pages 10 11)
[revmedia/copyrigh.htm]

Page last modified: 08/02/03