3 ms·
> I hate it, never used it You should at least use it in for loops. It's a useful improvement, and especially handy in combination with type inference. For exa
by clouddrover 3y ago
> I hate it, never used it
You should at least use it in for loops. It's a useful improvement, and especially handy in combination with type inference. For example:
for var i := 1 to 10 do
Inc (Total, i);
i is declared inline, it's only in scope inside the for loop, and the type is inferred from the bounds of the loop. You could of course use "for var i : Integer := 1 to 10 do" if you wanted to be explicit about the type.
Documentation: https://docwiki.embarcadero.com/RADStudio/Alexandria/en/Inline_Variable_Declaration https://docwiki.embarcadero.com/RADStudio/Alexandria/en/Inli...
- unnouinceput 3y agoPlease do another "for" right after this one, identical, and then revisit this comment (hint: you'll get a syntax error).
- clouddrover 3y ago> hint: you'll get a syntax error No. You won't. You didn't even try it, did you. Read the documentation, use inline variables, and be happy.