home *** CD-ROM | disk | FTP | other *** search
/ Media Share 13 / mediashare_13.zip / mediashare_13 / ZIPPED / PROGRAM / APR94_1.ZIP / ALLEY.ZIP / COMMON.PAS next >
Pascal/Delphi Source File  |  1994-01-04  |  2KB  |  64 lines

  1. (* ----------------------------------------------------------- *(
  2. **  common.pas -- Various constants, types, and subroutines    **
  3. ** ----------------------------------------------------------- **
  4. **                                                             **
  5. **                                                             **
  6. ** ----------------------------------------------------------- **
  7. **  Copyright (c) 1994 by Tom Swan. All rights reserved.       **
  8. )* ----------------------------------------------------------- *)
  9.  
  10. unit Common;
  11.  
  12. INTERFACE
  13.  
  14. const
  15.  
  16.   identStrLen = 64;
  17.  
  18.   digitSet = ['0' .. '9'];
  19.   upperSet = ['A' .. 'Z'];
  20.   lowerSet = ['a' .. 'z'];
  21.   alphaSet = upperSet + lowerSet;
  22.   identSet = alphaSet + digitSet + ['_'];
  23.  
  24. type
  25.  
  26.   IdentStr = String[identStrLen];
  27.  
  28. { Return lowercase equivalent of Ch }
  29. function DnCase(Ch: Char): Char;
  30.  
  31. { Convert all letters in identifier to lowercase }
  32. procedure DownCase(var Ident: IdentStr);
  33.  
  34. IMPLEMENTATION
  35.  
  36. { Return lowercase equivalent of Ch }
  37. function DnCase(Ch: Char): Char;
  38. begin
  39.   if Ch in upperSet
  40.     then Ch := Chr(Ord(Ch) + 32);
  41.   DnCase := Ch
  42. end;
  43.  
  44. { Convert all letters in identifier to lowercase }
  45. procedure DownCase(var Ident: IdentStr);
  46. var
  47.   I: Integer;
  48. begin
  49.   if Length(Ident) > 0 then
  50.     for I := 1 to Length(Ident) do
  51.       Ident[I] := DnCase(Ident[I])
  52. end;
  53.  
  54. begin
  55. end.
  56.  
  57.  
  58. (*
  59. // --------------------------------------------------------------
  60. // Copyright (c) 1993 by Tom Swan. All rights reserved
  61. // Revision 1.00    Date: 01/04/1994   Time: 09:38 am
  62. *)
  63.  
  64.