HP3000-L Archives

October 2005, 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:
donna garverick <[log in to unmask]>
Reply To:
Date:
Fri, 7 Oct 2005 10:21:16 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (64 lines)
hi all!

i'm looking at using the ci function 'pmatch' in a script...and thought
i would run some little tests before committing to using it.

here's the help text for pmatch:

Syntax:     PMATCH(pattern,str[,start])

Defn:       A CI evaluator function that searches for pattern
            in a string beginning at start.  Default start is 1.

Type:       Boolean

Example:    pmatch('f@','fread')
Result:     TRUE
Example:    pmatch('abc','abcd')
Result:     FALSE

so starting with:

  setvar x 'fread'

pmatch will indeed return true if you search for [log in to unmask]  if x is
modified to:

  setvar x 'fread silly'

pmatch will still (as expected) to return true when searching for [log in to unmask]
 however if you search for 's@', pmatch returns false!  given the help
text, i would fully expect pmatch to return true in this situation.

further experimentation shows that pmatch only works (returns true) if
the search pattern is set to look for what's at the beginning of the
string -- which strikes me as rather pointless.

the implied advantage of pmatch is that it will search for a pattern
(hence '@' (and obtw, are any of the other mpe wildcard symbols
supported (theoretically))) -- where str and pos only deal with
literals.

so -- is pmatch broke?             - d

Donna Garverick, HP-CSA   Sr. System Programmer
dgarverick -at- longs -dot- com
925-210-6631              Longs Drug Stores

Come, my friends, 'Tis not too late to seek a newer world.
Tho' much is taken, much abides; and tho'
We are not now that strength which in old days
Moved earth and heaven, that which we are, we are.
"Ulysses", A. Tennyson

>>>MY opinions, not Longs Drug Stores'<<<


		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2