I want to have my script repeat somthing 6 times. Could i use a varaible and have it repeat until the varible was equal to 6 or is there a more effictive way? If i was to use a varaible how would i do this
? Thanks.
Printable View
I want to have my script repeat somthing 6 times. Could i use a varaible and have it repeat until the varible was equal to 6 or is there a more effictive way? If i was to use a varaible how would i do this
? Thanks.
Yea, I usually do that
SCAR Code:repeat
i:=i+1;
dosomething
until i=6;
for also works just as well in this situation, (however I think that repeat is more flexible in other situations)
(The 6 might need to be 7.)Quote:
for i := 1 to 6 do
//action block here
Ok thanks guys.
I have another question what does indentifier expected mean?
You probaly have not have Enough End; (s)
ok, thanks
Counting starts from 0
So..
it can be 7 or 6 ( Not sure lol )
~Home
program New;
var i :integer;
procedure lala;
begin;
for i := 1 to 6 do
Writeln('lol')
end;
begin
lala;
end.
That will repeat, writeln('lol') six times :D
ok ok, so see how many times it repeats, try this
it doesnt have to be f, it can be any integer variable.Code:for f:=0 to 6 do
writeln('f = '+inttostr(f))
and for loops can start from anywhere, it can be for f:=10 to 60 do