Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2010-10

Is it possible to create a loop

6 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Sven Barth
to Bizugo
Bizugo wrote 5 lines
Is possible to create a loop using a code like this one: for var J: integer = X to Y do {...} Thanks.

No, it isn't. You must declare the type at the beginning of the function/procedure.

Regards,
Sven

Reply by email

dennis martin
to Bizugo: Is possible to create a loop using a code like this one: for var J: integer = X to Y do…
procedure test;
var cnt : integer;
begin
 for cnt := 1 to whatever  do ( your procedure )
end;
Bizugo wrote 19 lines
From: Bizugo Subject: [Lazarus] Is it possible to create a loop To: Date: Sunday, October 3, 2010, 2:01 PM Is possible to create a loop using a code like this one: for var J: integer = X to Y do {...} Thanks. - Bizz. -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Bizugo
to Sven Barth: No, it isn't. You must declare the type at the beginning of the function/procedure. Sven

Thanks for the replies, I was thinking that the FPC could have a php-like for...

for(var;condition;add)
for($i=0;$i<X;$i++) { Codes }

I was just guessing, thanks for the replies.

Sven Barth wrote 18 lines
On 03.10.2010 20:01, Bizugo wrote: > Is possible to create a loop using a code like this one: > > for var J: integer = X to Y do {...} > > Thanks. No, it isn't. You must declare the type at the beginning of the function/procedure. Regards, Sven -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Nikolay Nikolov
to Bizugo: Is possible to create a loop using a code like this one: for var J: integer = X to Y do…
Bizugo wrote
Is possible to create a loop using a code like this one: for var J: integer = X to Y do {...}

No, but if you're using Lazarus and want to save typing, you can write:

for I := 1 to 10 do

and then press Ctrl+Shift+C and it will automatically add I: Integer to your local variable list, so you can write it just as fast, and most importantly, without the need to move the cursor back to the variable list.

Reply by email