Check out and contribute to CodePedia, the wiki for developers.

View \BIGCASE.PAS

This is the second disk of the PASCAL TUTOR system. It has the

Submitted By: WEBMASTER
Rating: (Not rated) (Rate It)


(* Chapter 4 - Program 9 *)
program A_Bigger_Case_Example;

var Count : integer;
    Index : byte;

begin  (* main program *)
   for Count := 1 to 10 do begin
      Write(Count:5);
         case Count of
           7..9  : Write(' Big Number');
           2,4,6 : begin Write(' Small');
                         Write(' even');
                         Write(' number.');
                   end;
           3 : for Index := 1 to 3 do Write(' Boo');
           1 : if TRUE then begin Write(' TRUE is True,');
                                  Write(' and this is dumb.');
                            end;
         else Write(' This number is not in the allowable list');
         end; (* of case structure *)
      Writeln;
   end(* of Count loop *)
end(* of main program *)

corner
© 1996-2008. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Publisher: Lars Hagelin.
bootstrapLabs Logo A bootstrapLabs project.