[fpc-devel] Declare variables inside the code

Vincent Snijders vincent.snijders at gmail.com
Tue May 10 19:28:36 CEST 2011


2011/5/10 kingbizugo at gmail.com <kingbizugo at gmail.com>:
> I have been playing on other languages sometimes and I see some features
> that speed-up a lot the code creating. I'm posting here one, I want to see
> what you think about it.
>
> Good: fast algorithm testings, code creating
> Bad?: not a standard of the pascal language
>
> method MyMethod;
> var A, B: Integer;
> begin
>
> { Simple sample of a variable inside the method begin/end near to a for-loop
> }
> var I: Integer;
> for I := a to b do...
>
> { Or even }
> for var J: Integer := a to b do...
> { This is normal on languages like C++ and Java }
>
> end;
>
> What do you think about?

To speed up code creation, use an IDE:
http://wiki.lazarus.freepascal.org/Lazarus_IDE_Tools#Variable_Declaration_Completion

Vincent



More information about the fpc-devel mailing list