Delphi 2005 Pro
TypeCasting
Function
Int64

Hello i have a function where i use
result:=0;
then i loop trough a list and update result if i find a match.

Now when calling the function i expect 0 then a match is not found instead i get 18...........etc as a result which means an uninitialized int64. Why? I believe last week when i tested it i got 0. I do a typecast in calling the function e.g. it is in another class that is passed as an object to the current class. E.g. the code is findfile that is called from TVirtualFileStream.Create . Code can be found in vfs.

[EDIT]
I Just discovered that on setting a breakpoint on result:=0; the breakpoint is ignored as the compiler seems to not compile the line (due to optimizations). Why?
[/EDIT]