############################################################################
#
# File: records.icn
#
# Subject: Procedures to manipulate records
#
# Authors: Ralph E. Griswold and Gregg M. Townsend
#
# Date: November 16, 2000
#
############################################################################
#
# This file is in the public domain.
#
############################################################################
#
# field(R, i) returns the name of the ith field of R.
#
# fieldnum(R, s) returns the index of the field named s in record R.
#
############################################################################
procedure field(R, i) #: return name of field R[i]
name(R[i]) ? {
tab(upto('.') + 1)
return tab(0)
}
end
procedure fieldnum(R, s) #: return index of field R.s
local i
R := copy(R)
every i := 1 to *R do
R[i] := i
return R[s]
end
This page produced by UniDoc on 2021/04/15 @ 23:59:44.