locked
Range of values in switch RRS feed

  • Question

  • This is a really silly question, but for the life of me I cannot figure out how to test for a range of values in a switch activity.  Basically it should look like: (I am a c# guy so forgive any syntax errors)

    Select case Insured.Amount

      case 0 to 100 

    underwriterName = "John"

      case 101 to 1000

       underwriterName = "Tom"

      case else

    underwriterName = "Jerry"

    End Select

     

    Tried using it in a workflow, and in a flowchart - all different variations of it.  Any suggestions / reading materials would be helpful

    Thanks,

    John

    Friday, January 28, 2011 9:17 PM

Answers

  • I don't know if it is the best way to do it, but I figured out nested If statements will do the trick.  And it looks like the communication between workflow activities is a dictionary, so the case conditions look for the key.   If anyone has any other ways of doing it please share. :)

    If(insured.Amount >= 0 And insured.Amount <= 50, "0-50",
        If(insured.Amount > 50 And insured.Amount <= 100, "51-100",
           If(insured.Amount > 100 And insured.Amount <= 150, "101-150",
               ">150")
        )
    )
    • Marked as answer by John Hennesey Saturday, January 29, 2011 2:14 AM
    Saturday, January 29, 2011 2:14 AM