Re: 4GL command line parsing functions
Posted in 1995
Walt, No, instring() is not a standard part of I4GL. I attach the missing code in another shell archive. I plead carelessness (and forgetfulness -- I didn't remember sending it out before, though I'm not surprised to find that I did), and the archive is correct. I'd expect that the code I sent now is identical to the archive version as I don't seem to have changed it for about 5 years! It also probably isn't worth duplicating this code in the ftp archive. Yours, Jonathan Leffler (johnl@informix.com) #include <disclaimer.h> >Date: Thu, 6 Jul 1995 10:27:31 -0400 >From: Walt Hultgren {rmy} <walt@mathcs.emory.edu> >To: johnl@informix.com >Subject: Re: 4GL command line parsing functions > >Jonathan, > >The getopt code you posted yesterday references a function "instring", but >you didn't include it in the shar file. It *is* included in the version >in the ftp archive on mathcs.emory.edu. Is instring() now in the 4GL >library. It's not in ours here, but we're still on 4.11.UC1. : "@(#)shar.sh 1.9" #! /bin/sh # # This is a shell archive. # Remove everything above this line and run sh on the resulting file. # If this archive is complete, you will see this message at the end: # "All files extracted" # # Created: Thu Jul 6 08:49:07 PDT 1995 by johnl at Informix Software Ltd. # Files archived in this archive: # instring.4gl # #-------------------- if [ -f instring.4gl -a "$1" != "-c" ] then echo shar: instring.4gl already exists else echo 'x - instring.4gl (415 characters)' sed -e 's/^X//' >instring.4gl <<'SHAR-EOF' X{ X @(#)instring.4gl 1.1 90/07/19 X @(#)Sphinx Informix Tools: General Library X @(#)Find index of character in string X @(#)Author: JL X} X XFUNCTION instring(str, c) X X DEFINE X str CHAR(80), X c CHAR(1), X sccs CHAR(1), X l INTEGER, X i INTEGER X X LET l = length(str) X X FOR i = 1 TO l X IF str[i] = c THEN X RETURN i X END IF X END FOR X X RETURN 0 X X LET sccs = "@(#)instring.4gl 1.1 90/07/19" X XEND FUNCTION {instring} SHAR-EOF chmod 444 instring.4gl if [ `wc -c <instring.4gl` -ne 415 ] then echo shar: instring.4gl unpacked with wrong size fi # end of overwriting check fi echo All files extracted exit 0