Project: | Prolint Issue Tracker |
Component: | Rules |
Category: | bug report |
Priority: | minor |
Assigned: | Unassigned |
Status: | won't fix |
(originally issued by dlauzon)
I get this notification ("wrong usage of ASSIGN..WHEN..statement") when I use something like:
---
ASSIGN
lLogical = FALSE WHEN lLogical = ?
...
.
---
Since the variable in the WHEN is on the same line, it's evident that it uses the value of the variable as it was before the ASSIGN, it's not confounding as if I had:
ASSIGN
lLogical = ?
...
lLogical = FALSE WHEN lLogical = ?
.
It's not different then with a non-ASSIGN.
e.g.
If I have:
cSomeVar = cSomeVar + "hello".
I know that the right cSomeVar is the value of cSomeVar prior to this line.
Comments
agreed, but complicated
Thanks, I agree it is too restrictive, but it will be quite difficult to fix. Back to your example:
Having lLogical on the same line is not really a good filter, see following example:
Ok it is a bit far fetched, but I think it illustrates the complexity of the algorithm :-)
Intent
Being on the same line may indicate programmer intent, but it doesn't matter to the compiler.
I guess I would wonder why you want to write code like this instead of
If iLogical = ? THEN iLogical = FALSE.
which is so much clearer.
#1
Won't fix this, because I would not know how. Sorry.
#2
Tim Townsend wrote:
Is it really that hard? I would think it would just be:
IOW, we are looking for fields that are referenced in a when clause and that are assigned a value on a previous line in the same assign statement, since that is the case where Progress' behavior is not what you might expect. Or maybe I'm missing something, it's happened before. :)
#3
I am not interested in fixing this, but if someone else would like to give it try...