Shuttleu
2010-12-10 17:24:06
function BoolToInt(TheBool: Boolean): Integer;
begin
if (TheBool) then
Result:= 1;
end;
i think this would allow us to easily make scripts without having to check the bool
example: without BoolToInt
TehBool:= True;
RandomArray:= [2, 4];
if TehBool then
Writeln(RandomArray[1])
else
Writeln(RandomArray[0]);
example: with BoolToInt
TehBool:= True;
RandomArray:= [2, 4];
Writeln(RandomArray[BoolToInt(TehBool)]);
~shut