home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
OL.LZH
/
PROCS.LZH
/
ADJUNCTS.ICN
next >
Wrap
Text File
|
1991-09-05
|
1KB
|
76 lines
############################################################################
#
# Name: adjuncts.icn
#
# Title: adjuncts (adjunct utilities for gettext and idxtext)
#
# Author: Richard L. Goerwitz
#
# Version: 1.2
#
# Date: June 1, 1991
#
############################################################################
#
# Pretty mundane stuff. Basename(), Pathname(), Strip(), and a utility
# for creating index filenames.
#
############################################################################
#
# See also: gettext.icn, idxtext,icn
#
############################################################################
global _slash, _baselen
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