Question:

How to use "and" in VB6?

by  |  earlier

0 LIKES UnLike

Every language except VB has an "and" statement that by default stops evaluating the statement once a false has been encountered. In VB.NET they have "AndAlso" which does this. My question is - in VB6 does someone know how you accomplish this, or maybe a trick to get the same effect?

 Tags:

   Report

3 ANSWERS


  1. If statement = 2 && statement.size = 2 then whatever.

    Booleans should work.


  2. You would have to evaluate each logical expression one at a time

    If (Not IsNull(a)) Then

      If (a>12) Then

        (expression)

      End if

    End if

    The second (and further) comparison would not be made unless the first one evaluated to True.

  3. It is simply AND operator just like the following example:

    IF x = 4 AND y > 5 THEN z = x * y

    That's how to use it ;)

Question Stats

Latest activity: earlier.
This question has 3 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.