[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: problems with some 'End' marks


On 29/3/25 2:39 pm, Benoît Minisini wrote:
Le 29/03/2025 à 03:05, BB a écrit :
WHY WAS THIS DONE!

Are we turning into python now?

Whitespace has hitherto meant nothing.

unhappy as I occassionally want to indent whole methods to make them stand out in the editor/printout.🙁

b


I done that to prevent an annoying mistake: if someone writes "End" instead of "End If" by mistake, the compiler emits errors hard to understand.

It took me a lot of minutes to find the problem in a small function written by someone else.

As "End" alone is only a keyword used for closing functions, and as functions cannot be nested, I chose to raise an error if the compiler sees "End" not at the beginning of the line.

I couldn't imagine that someone will indent a whole function for any reason!

Maybe I can replace that error by a warning? Or better take the entire indent into account and detect indent mismatch (beginning and end of function not with the same indent)?

Benoît, I can't agree. Anything that makes the code validity dependent on its starting point in the line just adds an impost on the coder that philosophically should not be there.

Surely, the case mentioned should have issued the "If without end if" error. Did it not do so?

b


Follow-Ups:
Re: problems with some 'End' marksClaus Dietrich <claus.dietrich@xxxxxxxxxx>
References:
problems with some 'End' marksCharlie Reinl <Karl.Reinl@xxxxxxxxxx>
Re: problems with some 'End' marksBruce Steers <bsteers4@xxxxxxxxx>
Re: problems with some 'End' marksBruce Steers <bsteers4@xxxxxxxxx>
Re: problems with some 'End' marksBB <adamnt42@xxxxxxxxx>
Re: problems with some 'End' marksBenoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx>