DIRECTORY StatsDefs USING [StatCounterIndex], StatsOps USING []; StatsHot: PROGRAM EXPORTS StatsDefs, StatsOps = BEGIN OPEN StatsDefs; statGrand: PUBLIC POINTER TO ARRAY StatCounterIndex OF LONG CARDINAL _ NIL; StatIncr: PUBLIC PROCEDURE [which: StatCounterIndex] = BEGIN IF statGrand#NIL THEN statGrand[which] _ statGrand[which] + 1; END; StatBump: PUBLIC PROCEDURE [which: StatCounterIndex, howmuch: CARDINAL] = BEGIN IF statGrand#NIL THEN statGrand[which] _ statGrand[which] + howmuch; END; StatGetCounter: PUBLIC PROCEDURE [which: StatCounterIndex] RETURNS [LONG CARDINAL] = BEGIN RETURN[IF statGrand#NIL THEN statGrand[which] ELSE 0]; END; END. ΐStatsHot.mesa Copyright c 1985 by Xerox Corporation. All rights reserved. HGM January 7, 1981 12:35 PM It would be nice if this were a MONITOR (locking StatsOps.statLock), but that slows things down a lot and complicates binding in the Pilot world. These are the master counters. They are the only ones that get bumped by StatIncr and StatBump. The numbers that StatSince prints out are obtained by subtracting two copies of statGrand. Κj˜codešœ ™ Kšœ Οmœ1™