link speedo
March 25, 2002; Robert J. Alexander
This file is in the public domain.
speedo -- a "percentage complete" graphic indicator for command-line-oriented user interfaces. This is a general facility that can function for anything, and a specific implementation for input files. The general implementation consists of two procedures: SpeedoNew -- Starts a speedo SpeedoValue -- Sets a new value for the speedo (non-decreasing) See FileSpeedo for an example of using the general facility. FileSpeedo is especially for input files. Here is how to use it, by example: f := open("input_file") | stop("!!!") FileSpeedo(f,75,&errout) # Start a file speedo, specifying # length and output file while read(f) do { FileSpeedo(f) # Keep it updated while reading file ... } FileSpeedo() # Finish up