mastaraymond
2010-01-18 08:16:46
So Wizzup is against this, but I think it's pro.. PS has a method somewhere that allows you to convert basically any datatype to a string, even ones created during runtime! So this might be a bit hackish, but It's definitely awesum!
Output:
program new;
type
LetsDoThis = record
str : string;
x,y : integer;
end;
LetsDoThis2 = record
str : string;
pt : TPoint;
end;
Yeah = array of LetsDoThis2;
ArrThis = array of yeah;
var
x : LetsDoThis;
y : arrthis;
j : TForm;
i,ii : integer;
begin
x.str := 'Testmebitch';
x.x := 500;
x.y := -900;
Writeln(x);
SetLength(y,2);
for i := 0 to high(y) do
begin;
setlength(y[i],2);
for ii := 0 to high(y[i]) do
begin;
y[i][ii].pt := Point(i*5,-random(9000));
y[i][ii].str := format('[%d][%d]=%s',[i,ii,tostr(y[i][ii].pt)]);
end;
end;
Writeln(y);
Writeln(TPointArray([Point(5,5),Point(20,1337),point(1,2)]));
J := TForm.Create(nil);
Writeln(j.canvas);
end.Output:
Compiled succesfully in 16 ms.
('Testmebitch', 500, -900)
[[('[0][0]=(0, -8379)', (0, -8379)), ('[0][1]=(0, -3182)', (0, -3182))], [('[1][0]=(5, -7787)', (5, -7787)), ('[1][1]=(5, -6094)', (5, -6094))]]
[(5, 5), (20, 1337), (1, 2)]
TControlCanvas
Succesfully executed