BenLand100
2007-06-13 15:08:38
During testing stuff everyone likes to print debug output, and for me its a pain writing IntToStr and FloatToStr all the time, and diplaying booleans is just a pain, so I wrote this. Feel free to extend it with other types, like TDateTime if its too your liking.
procedure println(line: Variant);
begin
case varType(line) of
256: writeln(line); //String
11: if line then writeln('True') else writeln('False') //Boolean
3: writeln(inttostr(line)); //Integer
5: writeln(floattostr(line)); //Float
else
writeln('Unknown Type: ' + inttostr(varType(line)));
end;
end;
begin
println('Hi');
println(42);
println(3.14);
println(true);
end.