I'm comparing the results produced when i use the 'Make .exe' compared to when i run the exact same process using the exact same variables though the IDE vb 6 debugger.
I've tried an array of different compiler options but to no avail.
So my question is why would i get a difference between the debugger and the 'Make .exe'?
have you ever come arross something similar and if so did you find a fix?
the program takes a large file of counts of cars in a timeperiod and averages them into 15 minute timeperiods for the day over a month for each route.
It elminates certain records depending on if there outside the standard deviation and other statistical algorithms To eliminate values.
its a bit to much code to post unfortunately...
Debug.Assert
and Debug.Print
Statement are not compiled into the binary. I sometimes use this to detect whether I am in the IDE or a compiled binary:
On Error Resume Next
Debug.Print 1/0
If Err=0 then
'Compiled Binary
else
'in the IDE
End if
Be careful with statements like this:
Debug.Assert( DoSomeThingImportend() )
In the compiled version this statement will not be executed.
I've found that in some (very rare) cases, there can be differences in compiled and debug code for VB6.
It might be worth trying the 'Compile to P-Code' option - sometimes this gives slightly different results from native code. You'll find it in Project Properties/Compile tab.
It's possible that if you post your algorithm, we'll be able to find more possibilities.
Edit: Since you can't post the algorithm, I'd suggest breaking the algorithm up incrementally and trying to work out where exactly the differences lie.
VB 6 is pretty solid when it comes to compilation consistency. But one possibility might be if you're relying in any way on events and using doevents to yield.
That combination can behave quite differently in the IDE vs compiled code.
I would guess you aren't, but, hey, something to check.
most of the times differences between compiled an debug version come from timing issues, the debug version is slightly slower and might miss some otherwise initialized values, or doesnt wait long enough for another part of the process to be finished
you can test this by adding some pauses in between the various parts of the code
often an extra DoEvent does the trick, or let some msgboxes pop up (you can then also compare the intermediate results from the compiled version with the debug version)
try to find out which part of the calculation gives the wrong result, and separate that part into a seperate function
often the difference occurs directly at the start (no time initialize), or somewhere during the process till the end (running behind on another process)