-
Declaration:
- Function StrAlloc (Len : Longint) : PChar;
-
Description:
- StrAlloc reserves memory on the heap for a string with length Len, terminating #0
included, and returns a pointer to it.
-
Errors:
- If there is not enough memory, a run-time error occurs.
-
See also:
- StrNew (683), StrPCopy (684).
-
Declaration:
- Function StrCat (Dest,Source : PChar) : PChar;
-
Description:
- Attaches Source to Dest and returns Dest.
-
Errors:
- No length checking is performed.
-
See also:
- Concat ()
Listing: stringex/ex11.pp
-
Declaration:
- Function StrComp (S1,S2 : PChar) : Longint;
-
Description:
- Compares the null-terminated strings S1 and S2. The result is
- A negative Longint when S1<S2.
- 0 when S1=S2.
- A positive Longint when S1>S2.
-
Errors:
- None.
-
See also:
- StrLComp (679), StrIComp (678), StrLIComp (681)
For an example, see StrLComp (679).
-
Declaration:
- Function StrCopy (Dest,Source : PChar) : PChar;
-
Description:
- Copy the null terminated string in Source to Dest, and returns a pointer to Dest. Dest
needs enough room to contain Source, i.e. StrLen(Source)+1 bytes.
-
Errors:
- No length checking is performed.
-
See also:
- StrPCopy (684), StrLCopy (680), StrECopy (676)
Listing: stringex/ex4.pp
-
Declaration:
- Procedure StrDispose (P : PChar);
-
Description:
- Removes the string in P from the heap and releases the memory.
-
Errors:
- None.
-
See also:
- Dispose () , StrNew (683)
Listing: stringex/ex17.pp
-
Declaration:
- Function StrECopy (Dest,Source : PChar) : PChar;
-
Description:
- Copies the Null-terminated string in Source to Dest, and returns a pointer to the end (i.e.
the terminating Null-character) of the copied string.
-
Errors:
- No length checking is performed.
-
See also:
- StrLCopy (680), StrCopy (675)
Listing: stringex/ex6.pp
-
Declaration:
- Function StrEnd (P : PChar) : PChar;
-
Description:
- Returns a pointer to the end of P. (i.e. to the terminating null-character.
-
Errors:
- None.
-
See also:
- StrLen (681)
Listing: stringex/ex7.pp
-
Declaration:
- Function StrIComp (S1,S2 : PChar) : Longint;
-
Description:
- Compares the null-terminated strings S1 and S2, ignoring case. The result is
- A negative Longint when S1<S2.
- 0 when S1=S2.
- A positive Longint when S1>S2.
-
Errors:
- None.
-
See also:
- StrLComp (679), StrComp (674), StrLIComp (681)
Listing: stringex/ex8.pp
-
Declaration:
- Function StrLCat (Dest,Source : PChar; MaxLen : Longint) : PChar;
-
Description:
- Adds MaxLen characters from Source to Dest, and adds a terminating null-character.
Returns Dest.
-
Errors:
- None.
-
See also:
- StrCat (674)
Listing: stringex/ex12.pp
-
Declaration:
- Function StrLComp (S1,S2 : PChar; L : Longint) : Longint;
-
Description:
- Compares maximum L characters of the null-terminated strings S1 and S2. The result
is
- A negative Longint when S1<S2.
- 0 when S1=S2.
- A positive Longint when S1>S2.
-
Errors:
- None.
-
See also:
- StrComp (674), StrIComp (678), StrLIComp (681)
Listing: stringex/ex8.pp
-
Declaration:
- Function StrLCopy (Dest,Source : PChar; MaxLen : Longint) : PChar;
-
Description:
- Copies MaxLen characters from Source to Dest, and makes Dest a null terminated string.
-
Errors:
- No length checking is performed.
-
See also:
- StrCopy (675), StrECopy (676)
Listing: stringex/ex5.pp
-
Declaration:
- Function StrLen (p : PChar) : Longint;
-
Description:
- Returns the length of the null-terminated string P.
-
Errors:
- None.
-
See also:
- Length ()
Listing: stringex/ex1.pp
-
Declaration:
- Function StrLIComp (S1,S2 : PChar; L : Longint) : Longint;
-
Description:
- Compares maximum L characters of the null-terminated strings S1 and S2, ignoring case. The
result is
- A negative Longint when S1<S2.
- 0 when S1=S2.
- A positive Longint when S1>S2.
-
Errors:
- None.
-
See also:
- StrLComp (679), StrComp (674), StrIComp (678)
For an example, see StrIComp (678)
-
Declaration:
- Function StrLower (P : PChar) : PChar;
-
Description:
- Converts P to an all-lowercase string. Returns P.
-
Errors:
- None.
-
See also:
- Upcase () , StrUpper (687)
Listing: stringex/ex14.pp
-
Declaration:
- Function StrMove (Dest,Source : PChar; MaxLen : Longint) : PChar;
-
Description:
- Copies MaxLen characters from Source to Dest. No terminating null-character is copied.
Returns Dest.
-
Errors:
- None.
-
See also:
- StrLCopy (680), StrCopy (675)
Listing: stringex/ex10.pp
-
Declaration:
- Function StrNew (P : PChar) : PChar;
-
Description:
- Copies P to the Heap, and returns a pointer to the copy.
-
Errors:
- Returns Nil if no memory was available for the copy.
-
See also:
- New () , StrCopy (675), StrDispose (676)
Listing: stringex/ex16.pp
-
Declaration:
- Function StrPas (P : PChar) : String;
-
Description:
- Converts a null terminated string in P to a Pascal string, and returns this string. The string
is truncated at 255 characters.
-
Errors:
- None.
-
See also:
- StrPCopy (684)
Listing: stringex/ex3.pp
-
Declaration:
- Function StrPCopy (Dest : PChar; Const Source : String) : PChar;
-
Description:
- Converts the Pascal string in Source to a Null-terminated string, and copies it to Dest.
Dest needs enough room to contain the string Source, i.e. Length(Source)+1 bytes.
-
Errors:
- No length checking is performed.
-
See also:
- StrPas (684)
Listing: stringex/ex2.pp
-
Declaration:
- Function StrPos (S1,S2 : PChar) : PChar;
-
Description:
- Returns a pointer to the first occurrence of S2 in S1. If S2 does not occur in S1, returns
Nil.
-
Errors:
- None.
-
See also:
- Pos () , StrScan (686), StrRScan (686)
Listing: stringex/ex15.pp
-
Declaration:
- Function StrRScan (P : PChar; C : Char) : PChar;
-
Description:
- Returns a pointer to the last occurrence of the character C in the null-terminated string P.
If C does not occur, returns Nil.
-
Errors:
- None.
-
See also:
- Pos () , StrScan (686), StrPos (685)
For an example, see StrScan (686).
-
Declaration:
- Function StrScan (P : PChar; C : Char) : PChar;
-
Description:
- Returns a pointer to the first occurrence of the character C in the null-terminated string P.
If C does not occur, returns Nil.
-
Errors:
- None.
-
See also:
- Pos () , StrRScan (686), StrPos (685)
Listing: stringex/ex13.pp
-
Declaration:
- Function StrUpper (P : PChar) : PChar;
-
Description:
- Converts P to an all-uppercase string. Returns P.
-
Errors:
- None.
-
See also:
- Upcase () , StrLower (682)
For an example, see StrLower (682)