I agree, Tony. The only time I use the statement is if I need to start a locate at something other than element 1 (to step through each matching element) or to locate multiple elements with the located value. Here's an example:

*
* Method of using LOCATE to find multiple occurrences of value delimited data
* using Reality form of LOCATE to use starting position parameter
*
START.PTR   = 1
FOUND.PTR   = 0
LOCATE.DONE = FALSE
*
LOOP
   LOCATE valuetofind IN ITEM(attr)<1>, START.PTR SETTING FOUND.PTR THEN
      whatever you want to do
   END ELSE
      LOCATE.DONE   = TRUE
   END
UNTIL LOCATE.DONE DO
   START.PTR = FOUND.PTR + 1
REPEAT

If someone knows how to do the same with the function I'd like to know. I still get nailed once in a while by the comma and semicolon, but not often.

Charlie

Tiny Bear's Wild Bird Store
"Everything For The Backyard Bird Enthusiast, Except For The Birds"
http://www.TinyBearWildBirdStore.com
Toll Free: 1-855-TinyBear (855-846-9232)


On 09-07-2012 4:53 PM, Tony Gravagno wrote:
I do the exact opposite for exactly the same reasons. :)
I use the Locate function rather than statement because I find it
easier to read and 99% consistent across all platforms.

T

From: John Lorentz
I fully believe that I've never used the function ever since they
introduced
it as an alternative to the function on Reality sometime in the late
70s.
While there are some small differences between Pick platforms on the
layout of the LOCATE statement (having to do with searching values,
subvalues, etc.), it's so much easier to read than using the
function.
But then, I've only been programming in Pick since 1978...
_______________________________________________
U2-Users mailing list
[email protected]
http://listserver.u2ug.org/mailman/listinfo/u2-users

_______________________________________________
U2-Users mailing list
[email protected]
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to