View Full Version : Variable Problems
Ruroken
09-07-2006, 09:16 PM
Ok i got a problem. I want a variable that at the beginning of the script equals "0" then after every loop "1" is added to it (so by the 3rd loop the variable will equal 3) this is the script i have doing it. the variable name is TimeRound. Waht am i doing wrong? Any help would be appreciated.
procedure WhatTimeRound;
begin
Timeround = 0;
end;
Procedure AddTimeRound;
begin
Timeround + 1;
end;
Cheesehunk
09-07-2006, 10:26 PM
Timeround:=0;
repeat
DoStuff;
Timeround:=Timeround+1;
until (Timeround=3);:)
Dankness
09-07-2006, 10:40 PM
Timeround:=0;
repeat
DoStuff;
Timeround:=Timeround+1;
until (Timeround=3);:)
why not do it this way
for TimeRound := 1 to 3 do
begin
DoThisStuff;
end;
Ruroken
09-08-2006, 01:39 AM
Thanks Cheesehunk and Dankness. Script Works now =P.
Cheesehunk
09-08-2006, 03:22 AM
why not do it this way
for TimeRound := 1 to 3 do
begin
DoThisStuff;
end;
Or this way?
while (not TimeRound=3) do
begin
DoStuff;
TimeRound:=TimeRound+1;
end;
I always forget about for..to..do statements.:tongue: Dankness's way is way more efficent, use that.
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.