Author Topic: Testing for connectors attached to connection points  (Read 884 times)

0 Members and 1 Guest are viewing this topic.

The Walrus

  • Jr. Member
  • **
  • Posts: 26
Re: Testing for connectors attached to connection points
« Reply #15 on: May 15, 2018, 03:49:55 PM »
Bah, why will this not work?

Code: [Select]
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

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3279
  • Ideas Visio-lized into solutions
Re: Testing for connectors attached to connection points
« Reply #16 on: May 15, 2018, 07:52:02 PM »
Should work...assuming everything is set correctly.
First 2 cases fail because I ententionally reversed the case condition signs.
Third case passes.

Code: [Select]
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
« Last Edit: May 15, 2018, 07:54:49 PM by wapperdude »
Visio 2007 Std

The Walrus

  • Jr. Member
  • **
  • Posts: 26
Re: Testing for connectors attached to connection points
« Reply #17 on: May 16, 2018, 09:39:23 AM »
In my macro, it's ignoring the 2nd argument.  For example, if I use

Code: [Select]
Case Is < CL, Is < CR
the code only checks for CL, and ignores CR.

If I use

Code: [Select]
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

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3279
  • Ideas Visio-lized into solutions
Re: Testing for connectors attached to connection points
« Reply #18 on: May 16, 2018, 11:52:44 AM »
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 2007 Std

The Walrus

  • Jr. Member
  • **
  • Posts: 26
Re: Testing for connectors attached to connection points
« Reply #19 on: May 18, 2018, 08:53:43 AM »
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