Search code examples
delphidelphi-10.3-rio

How to declare inline variables without error messages?


I'm using Delphi 10.3 Community Edition. When I write code with inline variable declarations like

var i:=1 to length(aStatement) do

the code compiles and runs as expected. No errors whatsoever. However, the IDE displays the code as if there were problems. Text is underlined with red squiggles and I'm told there are errors like "Expected an identifier but received VAR..." I get other "Expected...but received" and "Undeclared identifier" errors listed for code that follows the inline declaration.

What should I do to update the IDE to recognize this language change?


Solution

  • The only solution is to upgrade to Delphi 10.4, which fixes this very well-known bug.