home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Source Code 1992 March
/
Source_Code_CD-ROM_Walnut_Creek_March_1992.iso
/
usenet
/
altsrcs
/
3
/
3001
/
adjuncts.icn
< prev
next >
Wrap
Text File
|
1991-03-06
|
1KB
|
75 lines
############################################################################
#
# Name: adjuncts.icn
#
# Title: adjuncts (adjunct utilities for gettext and idxtext)
#
# Author: Richard L. Goerwitz
#
# Version: 1.1
#
############################################################################
#
# Pretty mundane stuff. Basename(), Pathname(), Strip(), and a utility
# for creating index filenames.
#
############################################################################
#
# Links: none
#
# See also: gettext.icn, idxtext,icn
#
############################################################################
procedure Basename(s)
# global _slash
s ? {
while tab(find(_slash)+1)
return tab(0)
}
end
procedure Pathname(s)
# global _slash
s2 := ""
s ? {
while s2 ||:= tab(find(_slash)+1)
return s2
}
end
procedure getidxname(FNAME)
#
# Discard path component. Cut basename down to a small enough
# size that the OS will be able to handle addition of the ex-
# tension ".IDX"
#
# global _slash, _baselen
return right(Strip(Basename(FNAME,_slash),'.'), _baselen, "x") || ".IDX"
end
procedure Strip(s,c)
local s2
s2 := ""
s ? {
while s2 ||:= tab(upto(c))
do tab(many(c))
s2 ||:= tab(0)
}
return s2
end