Posts: 309
Threads: 15
Joined: Jul 2003
EQV and IMP are also correct.
Aga,
why do you use
Code:
IF ... THEN
ELSE
IF ... THEN
END IF
END IF
rather than the shorter form
Code:
IF ... THEN
ELSEIF ... THEN
END IF
It is not that it really matters. I assume they execute the same, but your method requires one more END IF that you could forget.
hrist Jesus came into the world to save sinners, of whom I am first.(I Timothy 1:15)
For God so loved the world, that He gave His only begotten Son,
that whoever believes in Him should not perish, but have eternal life.(John 3:16)
Posts: 6,419
Threads: 74
Joined: Mar 2002
Quote:That's right........
................
Yeah, as I said, I was thinking in prolog
Posts: 691
Threads: 5
Joined: Apr 2002
Quote:Yeah, as I said, I was thinking in prolog
Yeah, defintely too much pot. Next thing you'll be programming in Prolog :o.
Aga, whats all this for anyway?
esus saves.... Passes to Moses, shoots, he scores!
Posts: 3,368
Threads: 195
Joined: Jan 2003
Another useless utility:
a converter to IF... THEN form, since it's more efficient..
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."
Visit www.neobasic.net to see rubbish in all its finest.
Posts: 144
Threads: 8
Joined: Feb 2004
Quote:Another useless utility:
a converter to IF... THEN form, since it's more efficient..
Is that because if you do this:
Even is a = 5, it will still test the b = 1 expression? That shouldn't be much of a difference at all, but eiether way, you couldn't get around it with OR, XOR, NOT, EQV, and probably IMP, but I don't know what that is.
Posts: 3,368
Threads: 195
Joined: Jan 2003
Quote:Even is a = 5, it will still test the b = 1 expression?
Yes, and there is a BIG difference. Try just one A OR B: it's twice as fast when the OR isn't there.
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."
Visit www.neobasic.net to see rubbish in all its finest.
Posts: 144
Threads: 8
Joined: Feb 2004
Quote:Quote:Even is a = 5, it will still test the b = 1 expression?
Yes, and there is a BIG difference. Try just one A OR B: it's twice as fast when the OR isn't there.
That really sucks that QB doesn't even try to optimize at all.
However, you could only get around it with AND.
Posts: 4,307
Threads: 63
Joined: May 2003
It is very frustrating to learn every now and then that QB's compiler doesnt optimize anything =(
Posts: 3,368
Threads: 195
Joined: Jan 2003
AND is also inefficient. It checks each truth value and doesn't exit out once a FALSE is reached.
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."
Visit www.neobasic.net to see rubbish in all its finest.
Posts: 4,307
Threads: 63
Joined: May 2003
=O were m$ developers brain dead or something while developing QB?