I use to have code for it and lost it during a format, and I haven't touched vb in awhile, so now I'm lost per say. I am trying to find numbers in a specific range.
Ex: 100-200
I want to only print those numbers in that range. If anyone has any data on how to do this it would be much appreciated.
Dim i As Integer
For i = 100 to 200
If NumberIsInRange(i) Then
DoSomethingWithNumber i
End If
Next
??
Thankxs MyndFyre, that'll work.
IIRC, dimensioning I as a Long will generally be a minute bit faster, as it will then allocate it to a long processor space (eax, ebx, ecx) instead of a memory space (AL, AH).
Quote from: Joe on December 13, 2005, 04:52 PM
IIRC, dimensioning I as a Long will generally be a minute bit faster, as it will then allocate it to a long processor space (eax, ebx, ecx) instead of a memory space (AL, AH).
Chances are since it's being used in a loop, unless VB is braindead, the counter will be in ECX anyway. And using 16-bit registers isn't any slower than 32-bit registers; it's when you're accessing memory that are not aligned at the four byte offsets when memory access gets slow.
VB is braindead, duh. =p
Hence the "IIRC", I figured I was probably wrong somewhere and didn't want to sound like an idiot.