PDA

View Full Version : Lol i was just being stupid



All that is man
09-08-2009, 10:25 AM
type
lol = boolean;
procedure writelnarray(aos: array of variant);
var i: integer;
begin
for i := 0 to high(aos) do
writeln(aos[i]);
end;
begin
writelnarray(['lol', 1, 'ohai der', true, lol]);
end.


and the debug:


Successfully compiled (49 ms)
lol
1
ohai der
True
26
Successfully executed


lol := 26?

Lance
09-08-2009, 11:31 AM
thats weird.. lol is a boolean. it should have returned 0 or False o.O

Sabzi
09-08-2009, 09:45 PM
I don't think lol is declared correctly.
However I don't know why it returns 26.
But just make it a const.
const
lol = True;
Or to a variable.
var
lol: Boolean;
Then you have to set it to True if you want because it's default False.