Help Answer

VB6: How To Pause A Program

Filed under: Programming — admin @ 11:41 pm

Just recently, I needed to implement a pause or delay loop in a Visual Basic 6 program.

Being lazy, my first instinct was just to do a for-next loop with a DoEvents in the middle. But this gave different results on different machines, which wasn’t what I was looking for.

The I tried using the Sleep API call.

(more…)

Visual Basic 6 Round Error

Filed under: Programming — admin @ 6:58 pm

I just hit an interesting error in VB6 today.

I was trying to calculate a distance between two points. No problem there except I didn’t want to put something on a page that said “48.723569″ miles. That would look dumb.

No problem, I thought, I’ll format the output using VB’s format command, giving the number string as “#####0.0″.

But for certain numbers, format kept giving me the answer 0.0

No problem, I’ll use Round instead.

Same error. Some calculations worked, others got rounded to zero regardless… (more…)

Powered by WordPress