home *** CD-ROM | disk | FTP | other *** search
/ SPACE 2 / SPACE - Library 2 - Volume 1.iso / program / 359 / def / string.def < prev    next >
Encoding:
Modula Definition  |  1989-01-09  |  3.1 KB  |  79 lines

  1. DEFINITION MODULE String;
  2. (*      File name: String.def                                   *)
  3. (*      Creation : March,1985                                   *)
  4. (*      Function : String function for Modula-2/68              *)
  5. (*      By       : Stan                                         *)
  6. (*                                                              *)
  7.  
  8. (*
  9. *    Copyright (c) 1985,1986,1987,1988,1989 by
  10. *    ana-systems, Foster City, California.
  11. *    All Rights Reserved.
  12. *
  13. *    This software is furnished under a license and may be used and copied
  14. *    only  in accordance with  the  terms  of  such  license and  with the
  15. *    inclusion of the above copyright notice.  This software or  any other
  16. *    copies thereof may not be provided or otherwise made available to any
  17. *    other  person.   No title to and ownership of the  software is  herby
  18. *    transferred.
  19. *
  20. *    The information in this software is  subject to change without notice
  21. *    and  should  not be construed as a commitment by ana-systems.   No
  22. *    warranty is implied or expressed.
  23. *
  24. *  SCCID  = "1.1    1/26/86"; 
  25. *)
  26. (*      History of modifcation                                  *)
  27. (*      Date            Who             Why                     *)
  28. (*                                                              *)
  29.  
  30. EXPORT QUALIFIED 
  31.         CompareResult,
  32.         Length,         Assign,         Insert,         Delete,
  33.         Position,       Substring,      Compare,        Concat;
  34.  
  35. TYPE
  36.         CompareResult = ( less, equal, greater);
  37.  
  38. PROCEDURE Assign ( VAR  source  : ARRAY OF CHAR;
  39.                    VAR dest    : ARRAY OF CHAR;
  40.                    VAR success : BOOLEAN );
  41. (* Assign array of char source to array of char dest. If copy is successful,
  42.   success will be true otherwise false.
  43.   If array of char dest is smaller than source, copy will exit with out
  44.   any copying
  45.  *)
  46.  
  47. PROCEDURE Length ( VAR str : ARRAY OF CHAR ) : CARDINAL;
  48.  
  49. PROCEDURE Insert ( VAR source  : ARRAY OF CHAR;
  50.                    VAR dest    : ARRAY OF CHAR;
  51.                        index   : CARDINAL;
  52.                    VAR success : BOOLEAN );
  53.  
  54. PROCEDURE Delete ( VAR str     : ARRAY OF CHAR;
  55.                        index   : CARDINAL;
  56.                        len     : CARDINAL;
  57.                    VAR success : BOOLEAN );
  58.  
  59. PROCEDURE Position ( VAR pattern : ARRAY OF CHAR;
  60.                       VAR source  : ARRAY OF CHAR;
  61.                       VAR index   : CARDINAL;
  62.                       VAR found   : BOOLEAN );
  63.  
  64. PROCEDURE Substring ( VAR    source : ARRAY OF CHAR;
  65.                           index  : CARDINAL;
  66.                           len    : CARDINAL;
  67.                       VAR dest   : ARRAY OF CHAR;
  68.                       VAR success : BOOLEAN );
  69.  
  70. PROCEDURE Concat ( VAR source1 : ARRAY OF CHAR;
  71.                    VAR source2 : ARRAY OF CHAR;
  72.                    VAR dest    : ARRAY OF CHAR;
  73.                    VAR success : BOOLEAN );
  74.  
  75. PROCEDURE Compare ( VAR string1 : ARRAY OF CHAR;
  76.                     VAR string2 : ARRAY OF CHAR) : CompareResult;
  77.  
  78. END String.
  79.