DIMension syntax checking...

John Esak john at valar.com
Mon Feb 6 22:38:09 PST 2006


Recently, I spent an hour trying to debug something that wasn't working,
when all I did was copy a large chunk of code and modiry it a little bit. I
made a typo when doing this and the syntax check didn't find it, so I kept
overlooking and not seeing the problem.

This probably relates to the fact that you can write lots of filePro code in
lots of ways and it still passes syntax check. I suppose this is because
filePro wants to allow for varying styles *within* strict syntax.... such
as:

     then: show("12","3") "blah" and show ("12","3") "blah"

are equivalent and pass syntax check. Fine, no problem. however, when I
copied the code today (that's how "recently" it was) I copied:

     dim date["3"]:bal(143);  dim pay["3"]:bal(50)

(and a whole bunch of other arrays like these...)

Then I went to the newly copied arrays, changed the overlay field, and and
pressed F1 at all the appropriate places to turned the lines into:

     dim date2["3"]:bal(160);  dim pay2["3"]:bal(60)

In other words I pressed F1 and "inserted" a 2 on all the array names.
Okay, everything should work fine, right. It did, except that it showed we
had an a/r of 5,895,233.23 instead of 41,610.23... :-)  A teeny-tiny
difference which my brilliant brain noticed immediately. :-)  Anyway, an
hour later after scrutinizing all the arrays, I finally asked Rick to go
over them because it just wasn't jumping out at me... What he saw... again
after a good 15 minutes of scrutinizing was one of the array lines looked
like this:

     dim date2["3"]:bal(160);  dim pay ["3"]:bal(60)

Now, assuredly, you are seeing the problem right away. I'm thinking/hoping
this is because this little nippet is not inside a much larger group of code
that all looks just about excatly like this.  Anyway, I'll take the lumps
for not catching it right away... but shouldn't the syntax checker have
helped along with this?  Why would it see pay ["3"]...  the same way it
would see pay["3"]...  Isn't this a different enough thing than show (r,c)
and show(r,c)?

Obviously, what I did as I was mechanically going along and changing all the
array names... was press F1 and insert the 2, but the 2 didn't get pressed
hard enough or whatever and I just missed it. My vote is that the syntax
checker should compalin about this. If for no other reason than to support
good form... and help poor programmers like me from wasting an hour with
code that can never work properly.

Just food for thought. I know there are hundreds of more important things to
see attention than this minor change to how things work now.  Besides, I
realize there are probably people out there who *want* it to work the way it
does not... but I would still argue for my view on this.
--
John Esak
(570) 384-2444

Author of:
The filePro Survivor Series
Complete Video Training For filePro On CD
See samples at: www.valar.com





More information about the Filepro-list mailing list