home *** CD-ROM | disk | FTP | other *** search
Modula Definition | 1987-10-17 | 1.0 KB | 47 lines |
- DEFINITION MODULE Strings;
-
- (* (C) Copyright 1987 Fitted Software Tools. All rights reserved. *)
-
- (*
- A strings is an ARRAY OF CHAR.
- If the string does not completely fill the array, it is terminated
- by a 0C.
- *)
-
- PROCEDURE CompareStr( s1, s2 :ARRAY OF CHAR ) :INTEGER;
- (*
- Returns:
- 0 if s1 = s2
- -1 if s1 < s2
- +1 if s1 > s2
- *)
-
- PROCEDURE Assign( VAR source, dest :ARRAY OF CHAR );
- (*
- copies source to dest
- *)
-
- PROCEDURE Length( s :ARRAY OF CHAR ) :CARDINAL;
- (*
- returns the length of s
- *)
-
- PROCEDURE Concat( s1, s2 :ARRAY OF CHAR; VAR result :ARRAY OF CHAR );
- (*
- Concatenates s2 to s1 and places the resulting string in result
- *)
-
- PROCEDURE Pos( subs, s :ARRAY OF CHAR ) :CARDINAL;
- (*
- Returns:
- index of first occurrence of subs in s or
- > HIGH(s) if no match is found
- *)
-
- PROCEDURE Append( VAR s1 :ARRAY OF CHAR; s2 :ARRAY OF CHAR );
- (*
- appends s2 at the end of s1.
- equivalent to Concat( s1, s2, s1 ), but more obvious and efficient.
- *)
-
- END Strings.