/* Fuel gauge example.
Syntax: GAUGE(expC, expN1, expN2) -> .T.
expC:	The text string at the top of the fuel gauge.
expN1:	The current value for the fuel gauge.
expN2:	The maximum value for the gauge.

Returns: Always returns .T.

Usage:
1) To initialize the gauge: Set expC to the desired text, and expN2 
	to the maximum value used.
2) To update the gauge: Set expN1 to desired value
3) To close the gauge: Set expN1 and expN2 to zero.

NOTES: 
1) In the initialization of the gauge, expN1 is ignored,
	In the updating gauge, expC and expN2 are ignored.
	In the closing of the gauge, expC is ignored.
2) Only one gauge can be active at once.  This also includes 
	the gauge used by INDEX ON.  If a user gauge is active, 
	and INDEX ON is performed, the INDEX ON gauge will
	not be shown.
3) Once created, the gauge is the 'active' window.
4) The range of expN1 and expN2 is 0 to 32767.
*/

// Initialize the fuel gauge.
GAUGE('Fuel Gauge Test', 0, 101)

// Option: since the gauge is the 'active' window, select the 
// CONSOLE window after creation.
select window 'CONSOLE'

for loop1 = 1 to 101
	// Update the fuel gauge
	GAUGE('', loop1, 0)
	// delay loop
	for loop2 = 1 to 100
		chkevent()
	next loop2
next loop1

// Option: since the gauge is the 'active' window, select the 
// CONSOLE window after completion.
//select window 'CONSOLE'
wait

// Execute the next line with expN1 and expN2 set to zero 
// to close the fuel gauge.
GAUGE('', 0, 0)
