SRL Archive - Other Scripts

CountBy(*);


Aser

2007-10-29 12:11:40

This is a function I thought I would make when I was bored…
It's kinda fun to play with for about 1 min

Won't work without boolean at the end but keeps giving me "result not used"
any help with that woudl be apreciated

Wizzup?

2007-10-29 12:17:24

What exactly do you want to make?

Aser

2007-10-29 12:20:20

I just want to make it count…which it already does
but I don't want it to give me "result not used"

nielsie95

2007-10-29 13:41:31

program new;

procedure CountBy(Number,Times,WaitTime: Integer);
var
a,b: Integer;
begin
a:=0;
b:=0;
repeat;
a:=a+Number;
b:=b+1;
WriteLn(IntToStr(a));
Wait(WaitTime);
until(b+1 > Times);
end;

begin
CountBy(1, 3, 1);
end.

I changed it to a procedure, procedures don't return anything; they just do what they're told. :)
Functions on the other hand return something (Boolean, Integer, String).
In your procedure you didn't need to return anything.. ;)

mat_de_b

2007-10-29 14:26:41

if you want it to return something then put

Result := 'what you want returned'

so for a number its

function HeyThere : integer;
begin
Result:= 5;
end;

Aser

2007-10-29 15:45:20

Thanks for telling me about putting it as a procedure nielsie95…
And thanks Mat for telling me about results