home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
magazine
/
dbms_mag
/
9101
/
olympia1.jan
< prev
next >
Wrap
Text File
|
1990-11-02
|
2KB
|
80 lines
LISTING 1 for Olympia/jan 91
PROCEDURE L_TBAR
*/ Displays the percent of processing completed, N_Current/N_Total.
*************************************************************
* PROCEDURE ....... : L_TBAR
* VERSION ......... : $Revision$
* LAST EDITED ON .. : $Date$
* LANGUAGE ........ : FoxPro
* CALLS TO ........ : L_Quote (see DBMS, 8/90 issue)
* PURPOSE ......... : Displays the percent of processing which has been
* : completed based upon the number of items or steps
* : which has been processed (N_Current) as a %
* : of the total number to be processed (N_Total).
* : The calling program is responsible for incrementing
* : the N_Current parameter each time through the
* * processing loop or at appropriate intervals.
* CALLING SEQUENCE : DO L_TBAR WITH <N_Current>, <N_Total>, <C_Message>
* LOCAL VARIABLES . : PCent, W_Tbar, Puffin
* GLOBAL VARIABLES : Begintime
* PARAMETERS ...... : N_Current, N_Total, C_Message
***************************************************************************
PARAMETERS N_Current, N_Total, C_Message
PRIVATE PCent, Puffin
* Initialize the local variables.
PCent = N_Current * 10 / N_Total
* Is this the first call?
IF .NOT. WEXIST('W_Tbar')
* Create the window display.
DEFINE WINDOW W_Tbar FROM 16,17 TO 22,62 DOUBLE COLOR +W/B
ACTIVATE WINDOW W_Tbar
@ 0,2 SAY PADC(C_Message,40) COLOR +W/B
@ 1,6 TO 3,37 COLOR +W/B
@ 4,6 SAY '0 1 2 3 4 5 6 7 8 9 10' COLOR W/B
* Turn off the cursor.
x = SYS(2002)
* Display the first quotation.
Begintime = VAL(SYS(2)) - Interval - 1
DO L_QUOTE
ENDIF
* Update thermometer display?
IF PCent > 0
* Display percent complete.
IF .NOT. WONTOP('W_Tbar')
ACTIVATE WINDOW W_Tbar
ENDIF
@ 2,7 SAY REPLICATE(CHR(219), ROUND(PCent*3,0)) COLOR W/B
* Is it time for a new quote from the Cookie database?
DO L_QUOTE
* Check for completion of processing.
IF N_Current >= N_Total
Puffin = INKEY(1)
DEACTIVATE WINDOW W_Tbar
RELEASE WINDOW W_Tbar
* Turn on the cursor.
x = SYS(2002,1)
* Clear the quote from the screen.
PrevWindow = IIF('' = WONTOP(), 'SCREEN', 'WINDOW '+WONTOP())
ACTIVATE SCREEN
@ 24,1 CLEAR TO 24,79
ACTIVATE &PrevWindow
ENDIF
ENDIF
RETURN