*/
If you have a PH account, you can customize your PH profile.
*/

View \FINDCHRS.PAS

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

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


(* Chapter 8 - Program 4 *)
program Find_All_Lower_Case_Characters;

const String_Size = 30;

type Low_Set = set of 'a'..'z';

var Data_Set    : Low_Set;
    Storage     : string[String_Size];
    Index       : 1..String_Size;
    Print_Group : string[26];

begin  (* main program *)
   Data_Set := [];
   Print_Group := '';
   Storage := 'This is a set test.';

   for Index := 1 to Length(Storage) do begin
      if Storage[Index] in ['a'..'z'] then begin
         if Storage[Index] in Data_Set then
            Writeln(Index:4,'   ',Storage[Index],
                         ' is already in the set')
         else begin
            Data_Set := Data_Set + [Storage[Index]];
            Print_Group := Print_Group + Storage[Index];
            Writeln(Index:4,'   ',Storage[Index],
                         ' added to group, complete group = ',
                         Print_Group);
         end;
      end
      else
         Writeln(Index:4,'   ',Storage[Index],
                       ' is not a lower case letter');
   end;
end(* of main program *)

corner
© 1996-2008 CommunityHeaven LLC. 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.
North American business development: Nicolai Wadstrom. Publisher: Lars Hagelin.