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
Printable View
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
What exactly do you want to make?
I just want to make it count...which it already does
but I don't want it to give me "result not used"
SCAR Code: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.. ;)
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;
Thanks for telling me about putting it as a procedure nielsie95...
And thanks Mat for telling me about results