Testing for connectors attached to connection points

Started by The Walrus, May 05, 2018, 02:00:32 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

The Walrus

Bah, why will this not work?

Case Is < CL, Is < CR

In other words,

Case is < CL OR Case is < CR

What am I missing here?
I use Visio 2013 Pro at work and 2016 Pro at home

wapperdude

#16
Should work...assuming everything is set correctly.
First 2 cases fail because I ententionally reversed the case condition signs.
Third case passes.


Sub test_case()
    Dim MyNum As Integer
    Dim aVal As Integer
    Dim bVal As Integer
   
    MyNum = 50
    aVal = 25
    bVal = 100
    Select Case MyNum
        Case Is < aVal
        Debug.Print MyNum; "is greater than"; aVal
       
        Case Is > 100
        Debug.Print MyNum; "is less than"; vBal
       
        Case Is < aVal, Is < bVal
        Debug.Print "OK"
    End Select
End Sub


Wapperdude
Visio 2019 Pro

The Walrus

In my macro, it's ignoring the 2nd argument.  For example, if I use

Case Is < CL, Is < CR

the code only checks for CL, and ignores CR.

If I use

Case Is < CR, Is < CL

the code checks for CR, and ignores CL.

Both CR and CL are integers, as is the variable tested against in the case statement.
I use Visio 2013 Pro at work and 2016 Pro at home

wapperdude

Did you try the macro...as a sanity check?

As provided, 3rd case, 1st condition fails, 2nd condition passes, debug prints OK.   This condition replicates your scenario.  I have we V2007.  But, nothing unique wrt this case structure.

Wapperdude
Visio 2019 Pro

The Walrus

I went back to If statements and everything works great.  No matter what I did, I could not get the case statement to test for the 2nd argument.

I posted the end result here.

Thank you for all your help!
I use Visio 2013 Pro at work and 2016 Pro at home