Help with CASE Statea

 BBS: Inland Empire Archive
Date: 05-23-92 (19:22)             Number: 158
From: RICHARD VANNOY               Refer#: NONE
  To: ZACK JONES                    Recvd: NO  
Subj: Help with CASE Statea          Conf: (2) Quik_Bas
ZJ>I wish there was a CASE OR statement e.g.
ZJ>SELECT CASE TestString $
ZJ>   CASE "abc" or "def" etc.
ZJ>END SELECT

THERE IS!   Commas are used for OR!  Watch:
            ^^^^^^

   SELECT CASE ASC(k$)
      CASE 48-57, 65-90, 97-122
         'Accepts all numbers, Upper case letters and Lower
         'case letters.
      CASE 27, 13
         'EXIT on ESCape or ENTER keys.
         EXIT SUB
   END SELECT

OR...

   SELECT CASE answer$
      CASE "Y", "y"
         'Do stuff for YES
      CASE "N", "n"
         'Do stuff for NO

> MegaMail 2.1b #0:Real compilers aren't case sensitive.


--- WM v2.01/91-0012
 * Origin: Com-Dat BBS  Hillsboro, OR.  HST (503) 681-0543 (1:105/314)
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET