Multiple AND's

1. ## Multiple AND's

This seems to work:

If (a = B) && (a = c) && (a = d) && (a = e) && (a = f) && (a = g) &&(a = g) && (a = i) && (a = j) && (a = k) && (a = l) THEN
m = 1
else
m = 0
endif

But is this the only way to do this?

Thanks  Reply With Quote

2. ## There are as many ways as you have imagination...
Code:
```	m=0
If (a = B) then
if (a = c) then
if (a = d) then
if (a = e) then
if (a = f) then
if (a = g) then
if (a = h) then
if (a = i) then
if (a = j) then
if (a = k) then
if (a = l) then m=1
endif
endif
endif
endif
endif
endif
endif
endif
endif
endif```
That one kinda looks pretty...  Reply With Quote

3. ## Code:
`IF (a*a*a*a*a*a*a*a*a*a*a) =  (a + b+ c +d +e + f +g +h +i +j +k +l) THEN DO`
Could this work?

_____________-  Reply With Quote

4. ## I initially thouhgt doing the addition thing... but it wouldn't work...

(a*11)=(b+c+d+e+f+g+h+i+j+k+l)

looks fine untill you consider the equation would still be true if one of the values was less than a, whilst another of the values was greater than a by the same amount.  Reply With Quote

5. ## Another way ...
Code:
```Idx   VAR BYTE
Vars  VAR BYTE
a   VAR Vars
b   VAR Vars
c   VAR Vars
d   VAR Vars
e   VAR Vars
f   VAR Vars
g   VAR Vars
h   VAR Vars
i   VAR Vars
j   VAR Vars
k   VAR Vars
l   VAR Vars
m   VAR BYTE

For Idx = 1 to 11
IF a != Vars[Idx] THEN m = 0 : GOTO VarTestDone
NEXT Idx
m = 1
VarTestDone:```  Reply With Quote

6. ## little useful question ...

Hi,TaznTex

As it looks close to logics ... Could you tell what kind of variables are "a" to "l" ???

Alain  Reply With Quote

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts