Hello fredvs, you wrote on Fri, 27 Mar 2020 18:30:11 -0700 (MST):
> I can understand that in a case of the variable is part of the procedure, > like this: ... > begin > case b of // here warning > 1: writeln('hello'); > end > end; ... > But for this, when the variable is global: ... > Here, imho, the warning is not really needed. There's no difference between the cases - why should a global variable be regarded any different from a local one? Because it's initalized by the start up code? Well, it might at any point in the program before be modified, and thus fall outside the range of values the case statement covers, what is the _reason_ for the warning. Your declaration even defines a variable that's initialized to an illegal value in the first place, using it without prior assignment should produce a program failure! > It is the case in mostly all the warning of msegui, so, imho, we may > disable the warning in that case. No. You wrote on Fri, 27 Mar 2020 18:39:41 -0700 (MST): > > I propose to add a - possibly empty, but AT LEAST commented! - default > > (else) clause. If you see that this clause will _never_ cause a problem, it can be left alone and be disregarded (until it may be needed). Otherwise this clause should rather raise an exception, so _if_ an extraneous case occurs, it will show up and can be handled, and the reason noted. (That's one of the problems with heritage: what's that good for?) > Yes I was thinking to do that but it is **lot of work**, +- 500 cases to > fix, sometimes in complicated code. Working on Windows? But even there you can get those fine Unix utilities like grep, awk, sed and others that make it easy to take care of such things. Certainly that's some work on the outset, but you can cover 500 cases with the same effort as only 5 or 15. And have the tools (and skills) ready for other, similar cases. -- -- (Weitergabe von Adressdaten, Telefonnummern u.ä. ohne Zustimmung nicht gestattet, ebenso Zusendung von Werbung oder ähnlichem) ----------------------------------------------------------- Mit freundlichen Grüßen, S. Schicktanz ----------------------------------------------------------- _______________________________________________ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk