tags:

views:

531

answers:

3

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...

+2  A: 

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.

dummy
No Debug.Assert and Debug.Print statements are in the code. (i've added them since I've had the code to help me with debugging but i've commented them out for this test)
Hath
A: 

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.

Ant
I've tried Compile to P-Code, but it still produced a difference for my test case. Posting the code might not be possible.. its pretty large.. plus my boss might not be over the moon about it. thanks tho
Hath
A: 

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.

drventure