Log in

View Full Version : Counting each time the script repeats successfully



zluo
05-18-2012, 06:46 AM
how can we count each time a script has performed successfully and write it in the debug box?

Recursive
05-18-2012, 06:49 AM
Inc(Count);
writeln(Inc(Count) + 'number of runs');
{Increases count by 1 each time it is successful}

incex(Count, Up);
writeln(Incex(Count, Up) + 'number of items made');
{Increases count by the number passed to up
So if you pass 2 to Up and Count is at 5, after this runs, Count = 7}

zluo
05-18-2012, 08:12 AM
procedure Main;
begin
repeat
DoSomething;
ClearDebug;
Inc(Count);
writeln(Inc(Count) + 1);
until(false);
end;

is this correct? because its not compiling correctly, and ihave no idea what i have done wrong

edit: nvm figured what i done wrong, thanks anyway

Home
05-18-2012, 08:33 AM
When you you solve it on your own, I suggest you to post the ix for everyone (If someone is having some what same problem).


Fixed version.

program new;



var
Count :Integer;

procedure Main;
begin
repeat
//DoSomething;
ClearDebug;
Inc(Count);
WriteLn(IntToStr(Count));
until(false);
end;



begin
Main;
end.


~Home