Craig Bennett pointerd out that
   TEST = '\AF1\CK1\CK2\H\LHC\MP\NU1\NU2\TK1\TK2\'
   IF INDEX(TEST,'\':F200.SCHEME.CODE:'\',1) THEN THAT = @FALSE
*can* generate a false positive if F200.SCHEME.CODE contains an embedded
slash.  In this case it can't, because the F200.SCHEME.CODE is validated
on entry against a list of codes (whew!)  The super long string I
started with is from a program to decide whether or not to show
something on a printout.
I suppose I could quibble and say it is actually a true positive...  but
no, Craig got me proper.  My bad.

However, this brings up a good practice thing to note.  The seperator
must not be 'enterable'.  So that makes INPUT a bad idea.  If you want
to try out an alternative, I just put
http://www.pickwiki.com/cgi-bin/wiki.pl?action=edit&id=GetKey up on the
wiki.  My problem was that the Asus eeePC does not seem to be a proper
xterm, so I reproduced most of the functionality of QM's keycode()
input.

===========================================
Looking back, I feel I may have defended the INDEX function more than I
wanted.  My own code generally looks like this

ENDWORDS = 'IF\OPEN\OPENSEQ\READNEXT\READ\READU\READV\READVU\'
ENDWORDS = ENDWORDS:'MATREAD\MATREADU\LOCATE'
CONVERT '\' TO AM IN ENDWORDS

and I use the classic form

 LOCATE(WORD,ENDWORDS;POSN) THEN

Regards, Keith

PS: The extra line is solely to prevent wrapping on an eighty-column
terminal.  I value my concept of readability above efficiency.
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to