SRL Archive - SRL Archives

Writeln


danrox2004

2007-04-12 21:02:30

This is very usefull… especially when debugging scripts with coordinates.. It writes in anything, so there is no need to do inttostr or booltostr.

procedure Write(Variants: Array of Variant);
var
i: integer;
Str: String;
begin
Str := '';
for i := 0 to (getarraylength(Variants) - 1) do
begin
Str := Str + Variants[i];
end
Writeln(Str);
end;

To Use:
It takes an array so put it in square brackets, seperated by comas. For example:
Write(['hello ', 54, ' Sup?', n, ' fjdksf ', True]);

Oops the title was supposed to be Write, not Writeln..

Ejjman

2007-04-12 21:50:05

Don't they already have soemthing like this? Well, sections such as proggy reports this would kick ass :) thanks.

Smartzkid

2007-04-12 23:07:05

I loves it!

EDIT: I loves it times infinity!

danrox2004

2007-04-22 02:12:30

From: Smartzkid
I loves it!

EDIT: I loves it times infinity!


lol, TY

Freddy1990

2007-04-23 13:01:25

Heh, I considered to make the exact same thing a few weeks ago ^^
Might write one and add it to SCAR
You could shorten it down a bit though, and for scar divi use length instead of getarraylength
procedure Write(Variants: array of Variant);
var
i: Integer;
Str: string;
begin
for i := 0 to Length(Variants) - 1 do
Str := Str + Variants[i];
Writeln(Str);
end;

Abyssal

2007-04-23 16:42:14

That is very leet, indeed.

I will most definitely be using this, thanks!

Spky

2007-04-23 17:38:53

Doesn't Scar have a format function?