AND, OR, XOR and NOT I understand. What I don't get are IMP and EQV. What do they mean? How'd they get in there? Is there any real use for them?
views:
223answers:
2
+1
Q:
What do the logical functions IMP and EQV do in VB6? Has anyone found a real world use for them?
+7
A:
IMP is "material implication" "a implies b" or "if a then b", which is equivalent to NOT a OR b. EQV is "equivalence" or "if and only if", so a EQV b is the same as (a IMP b) AND (b IMP a).
They got there because someone wanted to be complete. They can shorten some logical expressions, but you can always express the same thing with NOT and AND, NOT and OR, or with XOR alone.
Charlie Martin
2009-05-29 17:18:07
+1. You could add some linkage to the VB6 reference manual topics on IMP and EQV. http://msdn.microsoft.com/en-us/library/aa242794(VS.60).aspx and http://msdn.microsoft.com/en-us/library/aa242780(VS.60).aspx
MarkJ
2009-06-03 14:47:10
I *could*, but that would mean finding them. Ick. Thanks for doing so yourself,.
Charlie Martin
2009-06-03 21:33:39
A:
IIRC, they both perform a bitwise !XOR on the two inputs and return the result.
They are not present in any of the .Net code base (unless you count the VB6 compatibility layer library) so should be considered deprecated and therefor ignored.
Off the top of my head I can't say as I've ever used them.
David Spillett
2009-05-29 17:24:09