BB code in posts seems to be working again!
I haven't turned on every single tag, so please let me know if there are any that are used/needed but not activated.

Main Menu

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


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

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


Did you try the 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.

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

Browser ID: smf (possibly_robot)
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 4: index+Modifications.english (default), Post.english (default), Editor.english (default), Drafts.english (default).
Style sheets: 4: index.css, attachments.css, jquery.sceditor.css, responsive.css.
Hooks called: 223 (show)
Files included: 34 - 1306KB. (show)
Memory used: 1076KB.
Tokens: post-login.
Cache hits: 13: 0.00121s for 26,766 bytes (show)
Cache misses: 2: (show)
Queries used: 16.

[Show Queries]