home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / SIMTEL / CPMUG / CPMUG028.ARK / CASETEST.ALG < prev    next >
Text File  |  1984-04-29  |  707b  |  32 lines

  1. begin
  2.   comment This is a test program to test the functioning of the 
  3.           Algol-m case statement;
  4.   while 1=1 do
  5.       begin
  6.         integer num,input,index;
  7.         write("input test value");
  8.         
  9.         read(input);
  10.         case input of
  11.           begin
  12.            begin
  13.              write("0",input);
  14.            end;
  15.            begin
  16.             %this is case 1%
  17.             write("1",input);
  18.            end;
  19.            begin
  20.            write("2",input);
  21.              for index:=1 step 1 until input do
  22.                 begin
  23.                 write(index);
  24.               end;
  25.              end;
  26.            write("3"," ",input);
  27.           end;
  28.        end;
  29. end
  30. eof
  31.  
  32.