easier way to check for or logic 
Author Message
 easier way to check for or logic

if x +AD0- 15 or x +AD0- 16 or x +AD0- 20 or x +AD0- 30 then
...
end if

Can that be compressed?

Thanks,
Bodi



Sat, 21 Apr 2001 03:00:00 GMT  
 easier way to check for or logic
[This followup was posted to microsoft.public.vb.syntax and a copy was
sent to the cited author.]


Quote:
> if x +AD0- 15 or x +AD0- 16 or x +AD0- 20 or x +AD0- 30 then
> ...
> end if

> Can that be compressed?

> Thanks,
> Bodi

Hello,

Z = X + ADO
A = Z - 15
B = Z - 16
C = Z - 20
D = Z - 30

MyIF = A or B or C or D

--
Wanna thank me? Sign my GuestBook.
FlyKiller's Coding Room: http://users.atmosphere.be/flykiller
HomePage: http://home.tvd.be/ws36009



Sun, 22 Apr 2001 03:00:00 GMT  
 easier way to check for or logic
Can it be compressed?  I am not sure if I can read it:

Quote:
> if x +AD0- 15 or x +AD0- 16 or x +AD0- 20 or x +AD0- 30 then

Is that;
 If x=15 or x=16 or x=20 or x=30 then ....

If that is what your checking for, you can not compress that any
further.  You can shorten the code (if you have many of these to do)
by using an array to tell you if X is one of several values:

Const TestFor = "000000000000001100010000000001"

If Asc(Mid$(TestFor, X)) And 1 Then ...

LFS

F 10 14 1E

Quote:

> if x +AD0- 15 or x +AD0- 16 or x +AD0- 20 or x +AD0- 30 then
> ...
> end if

> Can that be compressed?

> Thanks,
> Bodi



Sun, 22 Apr 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Other easier simpler ways to access a mdb file from VB

2. Dirty Check Logic Help

3. EASY EASY EASY question

4. Easy One....How do I check if text is just numbers

5. Easy way to check for existence of ADO record

6. help easy easy question

7. easy filecopy question...but maybe not so easy

8. Need help with VBA logic! Should be easy.........

9. Ways to code - Performance

10. Different ways to open a Recordset

11. CreateObject seams to be slow, any ways to improve performance

12. All the possible ways to create an attachment

 

 
Powered by phpBB® Forum Software