Hi Ron,

A quick VLIST of the generated code shows that the compiler has taken the "DR" as a format string and applied it to the content of ARRAY<1> and then performed the LOCATE against that data.

Although not what you intended, this is actually consistent with the way in which SMA format expressions work. Personally, I hate them because of this sort of syntactically valid but semantically wrong error.


Martin Phillips
Ladybridge Systems Ltd
17b Coldstream Lane, Hardingstone, Northampton NN4 6DB, England
+44 (0)1604-709200

----- Original Message ----- From: "Ron Hutchings" <ron_hutchi...@hotmail.com>
To: <u2-users@listserver.u2ug.org>
Sent: Friday, July 16, 2010 8:28 PM
Subject: [U2] Locate Syntax Error Missed by Compiler



We are running 10.0.11, PICK flavor.

LOCATE STRING IN ARRAY<1> "DR" SETTING POS ELSE POS = 1

This compiled and executed but gave results we were not expecting. After some analysis and two sets of eyes, the aha moment that the BY was missing. LOCATE STRING IN ARRAY<1,1> BY "DR" SETTING POS ELSE POS = 1

It took us a while to look there since the compiler accepted it. When we found it we discussed that we really expected the syntax error to be identified by the compiler. Are we expecting too much from the compiler?

_________________________________________________________________
Your E-mail and More On-the-Go. Get Windows Live Hotmail Free.
http://clk.atdmt.com/GBL/go/196390709/direct/01/
_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to