wishlist item?
Bob Stockler
bob at trebor.iglou.com
Thu Jul 13 14:37:59 PDT 2006
Mark Luljak wrote (on Wed, Jul 12, 2006 at 07:47:25PM -0400):
| Just thought it might be nice to include a few things for DECLAREd variable
| usage. I ran into a situation where I declared a variable, tried to access
| it later, but had never actually assigned to it. It would be handy if the
| debugger kicked out warnings (maybe via an env var setting) that warned you
| if:
|
| * A variable was declared as local, but is never assigned
|
| * A variable is used in a comparison or as an rvalue but is never assigned
|
| The first would help weed out unused variables, certainly. The second
| helps with--quite frankly--stupid coding errors that never should be
| introduced in the first place. Sure, it's my fault the code was sliced and
| diced the way it was, but this -is- a trappable condition...why not notify
| the programmer of their folly?
|
| I could see omitting the second half of the feature request. The first
| half makes a lot of sense though.
|
| Watch, Bob Stockler'll post that his checksyn does this stuff already. :)
| Actually, if it doesn't, I may write something that does as a standalone
| program. But it would be cool to have rolled in.
Bob Stockler's processing table checking program doesn't check
for programmer's oversights like that. It's meant for those
of us who use a text editor -vs- [dr]cabe to create/edit tables,
and checks for things a poor typist (like me), or one who doesn't
monitor what he's typed very well (like me), or those who use cut
and paste in ScoTerm Windows to copy blocks of code in a table or
between tables (like me), and reports them. Here's the list:
#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#
Errors Checked
^^^^^^^^^^^^^^
This program checks for, and reports, on the following conditions.
Those marked with a * after the line number (instead of a -) are
not considered errors, but warning advisories.
Line: nnnn - NOT a filePro Processing Table Line (blank).
Line: nnnn - NOT a filePro Processing Table Line (garbage).
Line: nnnn - Too many colons. The line was not checked further.
Line: nnnn - Too few colons. The line was not checked further.
Line: nnnn - The Condition Line is too long (nnn characters).
Line: nnnn - The Statement Line is too long (nnn characters).
Line: nnnn - Unbalanced double quotes in the Condition Line.
Line: nnnn - Unbalanced double quotes in the Statement Line.
Line: nnnn - Label "nameeeee" is too long (n characters).
Line: nnnn - Label "na" is too short (n characters).
Line: nnnn - Label "na%me" contains illegal character(s).
Line: nnnn - Illegal, mispelled or incomplete Label: "@wlf"
Line: nnnn * Label "not" may not be tested.
Line: nnnn - Condition "not" can not be tested.
Line: nnnn - Array Name "this_array_name_is_too_long" is too long.
Line: nnnn - Array Name "na" is too short.
Line: nnnn - Array Name "na%me" contains illegal character(s).
Line: nnnn - Array "name" is improperly dimensioned.
Line: nnnn - Array Name "name" is a filePro command.
Line: nnnn - SET Command: "name" is NOT an Array Name.
Line: nnnn - CLEAR Command: "name" is NOT an Array Name.
Line: nnnn - Function Command missing "(": "command"
Line: nnnn - Declared Variable "sixtyfour_plus_name" is too long (65 chars).
Line: nnnn - Declared Variable "na" is too short (2 chars).
Line: nnnn - Declared Variable "na%me" contains illegal character(s).
Line: nnnn - Declared Variable "0name" begins with an illegal character: 0
Line: nnnn - Declared Variable "name" is a filePro command.
Line: nnnn * The Line contains literal ^A (not <ctrl>+A).
Line: nnnn * Alias assigned to unverified Real Field Name: "name"
In the following reports "Alias_Type" may be any of "LOOKUP", "EXPORT",
"IMPORT", "USER", "Real Field" or "Dummy Field":
Line: nnnn - Alias_Type Alias Name is too long (nn characters).
Line: nnnn - Alias_Type Alias Name is too short (n characters).
Line: nnnn - Alias_Type Alias Name begins with an illegal character: 1
Line: nnnn - Alias_Type Alias Name contains illegal character(s).
In the following report "Alias_Type" may be "LOOKUP", "EXPORT", "IMPORT"
or "USER". On "LOOKUP" lines it can be caused by a comment or another
command on the line, on the others it's caused only by another command
being on the line:
Line: nnnn - Alias_Type line contains Non-Alias_Type-Related characters.
In the following report "Alias_Type" may be "Real Field" or "Dummy Field":
Line: nnnn - Alias_Type Alias Name "name" is a filePro command.
All of the following summaries are reported after all processing table
lines have been read:
Label "name" is used n times (Lines: n, nn, nnn, nnnn).
Label and Array have the same Name: "label"
Array "name" is dimensioned n times (Lines: n, nn, nnn, nnnn).
Declared Variable "name" is declared n times (Lines: n, nn, nnn, nnnn).
Field Alias "name" is defined n times (Lines: n, nn, nnn, nnnn).
In the following summaries, "Alias_Type", "Alias_Type_1" and "Alias_Type_2"
may be any of "LOOKUP", "EXPORT", "IMPORT", "USER", "Real Field" or
"Dummy Field". These are all considered to be errors.
Label and Alias_Type Alias have the same Name: "name"
Array and Alias_Type Alias have the same Name: "name"
Alias_Type_1 & Alias_Type_2 Alias Names conflict: "name"
See instances of "NOTE:" in the program for the criteria I used to
determine if names are legitimate.
#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#
You won't like my Perl programming, because it's mostly a result
of using "a2p" on an AWK program I started with, but feel free to
roll your requirement into it (/u/bin/ck.syn on my system).
Bob
--
Bob Stockler +-+ bob at trebor.iglou.com +-+ http://members.iglou.com/trebor
More information about the Filepro-list
mailing list