HP3000-L Archives

July 1995, Week 1

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
MR JOHN P BURKE <[log in to unmask]>
Reply To:
MR JOHN P BURKE <[log in to unmask]>
Date:
Thu, 6 Jul 1995 14:37:53 EDT
Content-Type:
text/plain
Parts/Attachments:
text/plain (94 lines)
-- [ From: John P. Burke * EMC.Ver #2.10P ] --
 
On 7/5, Jeff Vance wrote:
 
>I've been adding some new CI evaluator functions over the weekend
(more
>on these later) and would like some help choosing the syntax for the
>word extraction function.
 
>Here is what I've got so far:
 
>   word(search_str,start [,nth] [,rtn_var] [,delims])
 
>where
 
>   search_str is the string that the word is being extracted from
>   start      is the beginning index in search_str to start looking
for
>              the word
>   nth        is which word to get (default is 1 for 1st).  Can be
>              negative to indicate nth from end of search_str (like
the
>              last parm of the pos() function.)
>   rtn_var    is a variable name that will contain the index in
>              search_str of the ending word delimiter.  Default is not
>              to return this info
>   delims     is a string containing characters that will be used to
>              delimit a word.  Default delimiters are: blank, comma,
>              semicolon, equalsign, tab, parenthesis, brackets, single
>              and double quotes.
 
[snip]
 
>I am also planning on adding a word replace function.
 
>I have enhanced rht() str() to accept an index rather than a character
>count for their last parameter.
 
>I have already added these new evaluator functions:
>  delimpos()  - find position of a delimiter(s), start must be
>                specified.
>  deblank()   - remove all blanks from a string, start may be
>                specified.
>  repl()      - replace "old" with "new" in a string, start must be
>                specified. Replace all is default, a count may be
>                specified.
>  pmatch()    - returns true if a pattern is found in a string.  Uses
>                MPE file name wildcard patterns.
 
[snip]
 
Steve Elmer then suggests:
 
[snip]
 
>How about a word count function too?
 
[snip]
 
To which Jeff responds:
 
[snip]
 
>I hadn't thought of that.  Can a few people give me examples of how
>they would use a word_cnt() function?
 
[snip]
 
Good additions to the CI.
 
It seems to me that word() is intended to provide much the same parsing
functionality within the CI as the mycommand() intrinsic provides to
programmers. In an ideal world, word() should follow the same format as
mycommand().
 
Since mycommand() uses an array to hold information about each token in
the string and since there is no such thing as a CI variable array, we
again are faced with a less than ideal world. However, the addition of
a
word_cnt() function coupled with Jeff's planned word() function would
allow us to use the same sort of logic as we are used to using with
mycommand().
 
I would also change the syntax (to as closely as possible resemble
mycommand() ):
 
  word(string [,delims] [,rtn_var] [,nth]
 
Of course, in a real ideal world, there would be a way to add
site-specific custom CI functions. :-)
 
John Burke
[log in to unmask]

ATOM RSS1 RSS2