home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
historic
/
v941.tgz
/
icon.v941src.tar
/
icon.v941src
/
ipl
/
progs
/
sample.icn
< prev
next >
Wrap
Text File
|
2000-07-29
|
772b
|
31 lines
############################################################################
#
# File: sample.icn
#
# Subject: Program to "sample" input stream
#
# Author: Ralph E. Griswold
#
# Date: January 21, 1999
#
############################################################################
#
# This file is in the public domain.
#
############################################################################
#
# This program filters the input stream, producing every ith
# value, starting at 1. i is given as a command-line argument; default 0.
#
############################################################################
procedure main(args)
local line, skip
skip := integer(args[1]) | 0
while write(read()) do
every 1 to skip do read()
end