File: selcase.bas

package info (click to toggle)
bwbasic 2.20pl2-11
  • links: PTS
  • area: main
  • in suites: buster, jessie, jessie-kfreebsd, stretch, wheezy
  • size: 1,236 kB
  • sloc: ansic: 21,001; makefile: 80
file content (31 lines) | stat: -rw-r--r-- 556 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
rem SelCase.bas  -- test SELECT CASE

Sub Main
   Print "SelCase.bas -- test SELECT CASE statement"
   Input "Enter a number"; d

   Select Case d

      Case 3 to 5
         Print "The number is between 3 and 5."

      Case 6
         Print "The number you entered is 6."

      Case 7 to 9
         Print "The number is between 7 and 9."

      Case If > 10
         Print "The number is greater than 10"

      Case If < 0
         Print "The number is less than 0"

      Case Else
         Print "The number is 1, 2 or 10."

   End Select

End Sub