• Welcome to Valhalla Legends Archive.
 

[VB] Check Range.

Started by LordNevar, December 13, 2005, 04:56 AM

Previous topic - Next topic

LordNevar

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.

A good fortune may forbode a bad luck, which may in turn disguise a good fortune.
The greatest trick the Devil ever pulled, was convincing the world he didn't exsist.

MyndFyre


Dim i As Integer
For i = 100 to 200
  If NumberIsInRange(i) Then
   DoSomethingWithNumber i
  End If
Next


??
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

LordNevar

Thankxs MyndFyre, that'll work.

A good fortune may forbode a bad luck, which may in turn disguise a good fortune.
The greatest trick the Devil ever pulled, was convincing the world he didn't exsist.

Joe[x86]

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: brew on April 25, 2007, 07:33 PM
that made me feel like a total idiot. this entire thing was useless.

MyndFyre

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.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

Joe[x86]

VB is braindead, duh. =p

Hence the "IIRC", I figured I was probably wrong somewhere and didn't want to sound like an idiot.
Quote from: brew on April 25, 2007, 07:33 PM
that made me feel like a total idiot. this entire thing was useless.