SRL Archive - SRL Archives

Debugln(text: string);


Bam Bam

2006-08-25 18:05:11

Procedure DebugLn(text: string);
var
a:integer;
begin
if(debug)then begin
a := getsystemtime div 1000;
writeln(text);
writeln('Time: '+inttostr(a)+'(seconds)');
end;
end;

I made this so that I could implement an optional script debuging feature, and seeing how it could be useful I thought i might share it…

Sumilion

2006-08-25 18:27:06

Im not sure i get what this does tho :confused:

Freddy1990

2006-08-25 18:52:01

this thing executes a writeln on the inputted string and afterward on the number of seconds that the computer has been running, but only if the debug boolean is true…
i don't get what the purpose of this is…

phantombmx

2006-08-26 10:49:28

you should instead make it the script time running (look below)
[php]procedure DebugLn(text: string);
var a :integer;
begin
if(Debug)then
begin
a := (getsystemtime - ST) / 1000;
WriteLn(text);
WriteLn('Time: ' + inttostr(a) + '(seconds)');
end;
end;[/php]

Bam Bam

2006-08-26 22:42:28

From: phantombmx
you should instead make it the script time running (look below)
[php]procedure DebugLn(text: string);
var a :integer;
begin
if(Debug)then
begin
a := (getsystemtime - ST) / 1000;
WriteLn(text);
WriteLn('Time: ' + inttostr(a) + '(seconds)');
end;
end;[/php]

The reason I made this is only because I was to lazy to type if (debug) then writeln('');, I use it to tell me what position the script is at without using the status bar it isnt anything special and anyone could have made one… Basicly this works like Fawkidebug only I made it so the 'if / then' statements could be somewhat reduced…