jeudi 1 octobre 2015

Does any version of Delphi warn about unbalanced if-else indentation?

I edited some Delphi 6 code from

if functionA then 
else procedureB

into

if functionA then
  if testC then procedureD
else procedureB

instead of the correct

if functionA then
  begin
  if testC then procedureD
  end
else procedureB

If the compiler had warned me the connected if-else wasn't equally indented I would have realized my error at compile time. Even if the original was

if not functionA then procedureB

I might have edited it into the wrong version.

Does any version of Delphi warn about unbalanced if-else indentation?

Aucun commentaire:

Enregistrer un commentaire