Sin
2012-03-12 14:42:56
Any idea how to call them?
Label;
if findthing then
begin
dostuff;
end else
if dothis then
Label;
2012-03-12 14:42:56
Label;
if findthing then
begin
dostuff;
end else
if dothis then
Label;
2012-03-12 15:01:34
goto LabelName;
2012-03-12 15:09:24
Label start;
writeln('loop');
if(not(x)) then
goto start;
2012-03-12 15:10:04
From: masterBB
This is a loop. Similar to repeat…until(x);
Label start;
writeln('loop');
if(not(x)) then
goto start;
From: Zyt3x
goto LabelName;
2012-03-13 04:04:43
2012-03-17 10:18:42
program new;
{$Define lape}
procedure Test1;
label
start;
var
i,b:Integer;
begin
i := 0;
start:
inc(i);
inc(b);
if i < 10000000 then
goto start;
end;
procedure Test2;
var
i,b:Integer;
begin
for i := 0 to 10000000 do
inc(b);
end;
var
timer:Integer;
begin
{$IFDEF lape}
timer := GetTickCount;
Test1;
writeln(GetTickCount - timer);
timer := GetTickCount;
Test2;
writeln(GetTickCount - timer);
{$ELSE}
timer := GetSystemTime;
Test1;
writeln(GetSystemTime - timer);
timer := GetSystemTime;
Test2;
writeln(GetSystemTime - timer);
{$ENDIF}
end.
2012-03-17 15:33:21
2012-03-17 16:09:17
2012-03-17 16:13:50
2012-03-17 16:16:21
2012-03-17 16:18:32
From: Home
Don't use Labels.
If you need to use Labels. Then re-do your function :)
I know that this might sound like a spam, but it's not it. I used Labels too once way too often, then I decided to re-write whole function and result was much better!
~Home
2012-03-17 16:21:14