home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
OL.LZH
/
PROCS.LZH
/
USAGE.ICN
< prev
next >
Wrap
Text File
|
1991-09-05
|
2KB
|
65 lines
############################################################################
#
# Name: usage.icn
#
# Title: Service procedures
#
# Author: Ralph E. Griswold
#
# Date: July 19, 1991
#
############################################################################
#
# These procedures provide various common services:
#
# Usage(s) stops executions with a message concerning the
# expected form of usage of a program.
#
# Error(L[]) writes arguments to &errout and returns.
#
#
# ErrorCheck(l,f) reports an error that has been converted to
# failure.
#
# Feature(s) succeeds if feature s is available in the running
# implementation of Icon.
#
# Requires(s) terminates execution is feature s is not available.
#
# Signature() writes the version, host, and features support in
# the running implementation of Icon.
#
############################################################################
procedure Usage(s)
stop("Usage: ",s)
end
procedure Error(L[])
push(L,"*** ")
push(L, &errout)
write ! L
end
procedure ErrorCheck(line,file)
if &errortext == "" then fail # No converted error
write("\nError ",&errornumber," at line ",line, " in file ",file)
write(&errortext)
write("offending value: ",image(&errorvalue))
return
end
procedure Feature(s)
if s == &features then return else fail
end
procedure Requires(s)
if not(Feature(s)) then stop(s," required")
end
procedure Signature()
write(&version)
write(&host)
every write(&features)
end