Bixby Sayz
2011-04-14 18:15:16
Didn't want to spam up the rest of the forums so thought I'd put it in here. Just wanted to bitch and whine and stamp my feet. Oh and pout too!
I seem to be always bumping my head into subtle "gotchas" when scripting, wasting hours trying to track down what is going on.
Here's an example:
I seem to be always bumping my head into subtle "gotchas" when scripting, wasting hours trying to track down what is going on.
Here's an example:
program new;
var
BoolVar: Boolean;
function BoolFunc: Boolean;
begin
Result := False; // The "magic" happens here
if not BoolVar then
begin
WriteLn('BoolVar is False inside function (without an assignment)');
Exit;
end;
// Some other code here which we never get to
Result := True;
end;
begin
ClearDebug;
BoolVar := True;
BoolVar := BoolFunc;
WriteLn(BoolToStr(BoolVar));
end.And the output looks like:BoolVar is False inside function (without an assignment)
False
Successfully executed.Bugger me! Took me an entire day to find that one.