News for hackers. Stuff that matters.
Re:IBM will offer free COBOL training by ptx on Saturday April 11, 2020 @07:54AM (#22841184)
That looks a lot like Visual Basic, except it allows you to name the patterns.

  sub letters
      dim char as string
      do
          char = inputbox("Enter lower-case character or digit. No data ends.")
          select case char
              case "a", "e", "i", "o", "u"
                  msgbox "The letter " & char & " is a vowel."
              case "b", "c", "d", "f", "g", "h", _
                   "j" to "n", "p" to "t", "v" to "z"
                   msgbox "The letter " & char & " is a consonant."
              case "0" to "9"
                  msgbox char & " is a digit."
              case else
                  exit do
          end select
      loop
  end sub
(This example is actually LibreOffice Basic, as I'm not on a Windows machine right now, but it should be the same in VBA and VB6.)
Re:IBM will offer free COBOL training by msla on Saturday April 11, 2020 @02:12PM (#22843119)
> That looks a lot like Visual Basic, except it allows you to name the patterns.

More to the point, it allows you to keep the patterns near the variable declaration, so you can reuse them.

The pattern matching is part of how the data is declared.

Re:IBM will offer free COBOL training by ptx on Saturday April 11, 2020 @03:06PM (#22843449)
Can you also reuse them for different variables, if you want to store two of these chars? This program appears to have the patterns declared as part of the variable declaration.