TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Andrew Clegg
from: Jonathan de Boyne Pollard
date: 1995-04-13 08:51:58
subject: Flow control in REXX

ZZ>
  > Does REXX have an equivalent of C's switch/case or Pascal's case staements?
ZZ>

  Excerpted from one of my more famous scripts :

/*                                                                      */
/* BlueWaveAuto -- A function to handle BlueWave automail, as set up by */
/* Richard McGillivary on DoNoR/2.                                      */
/*                                                                      */

BlueWaveAuto: procedure

    Done = 0 ;

    Result = SendLW("1") ;/* Start BlueWave automail from the main menu. */

    do until (Done)

       prompt=FindLW("download your Bluewave automail",
                    ,"delete your Bluewave automail",
                    ,"File(s) to download",
                    ,"NO Bluewave Automail" ) ;

       select
       when prompt="download your Bluewave automail" then Result
= SendLW("Y") 
       when prompt="delete your Bluewave automail" then do

        /* Your automail file is now in your download directory.  Now   */
        /* is the time to START a background batch file to deal with    */
        /* it.  It is OK for the BBS to delete it.                      */

            Result = SendLW("Y") ;
            Done = 1 ;
       end
       when prompt="File(s) to download" then Result =
SendLW("^M") ;
       when prompt="NO Bluewave Automail" then Done = 1 ;
       otherwise Result = SendLW("^M") ;
       end

    end

    return "" ;

  The full script (it's for LiveWire 2.2) is available in the ZJP file
  area, if memory serves.  (-:

  > JdeBP <
___
 X MegaMail 2.10 #0:

--- Maximus/2 2.02
* Origin: DoNoR/2,Woking UK (44-1483-722344) (2:440/4)
SEEN-BY: 105/42 620/243 711/401 409 410 413 430 807 808 809 934 955 712/407
SEEN-BY: 712/515 628 704 713/888 800/1 7877/2809
@PATH: 440/4 141/209 270/101 105/103 42 712/515 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.