Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
logical operators Q
#11
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)
Reply
#12
Quote:That's right........

................
Yeah, as I said, I was thinking in prolog Tongue
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#13
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!
Reply
#14
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.
Reply
#15
Quote:Another useless utility:

a converter to IF... THEN form, since it's more efficient..

Is that because if you do this:

Code:
IF a = 1 AND b = 1

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.
Reply
#16
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.
Reply
#17
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.
Reply
#18
It is very frustrating to learn every now and then that QB's compiler doesnt optimize anything =(
Reply
#19
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.
Reply
#20
=O were m$ developers brain dead or something while developing QB?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)