| [Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | 
Allocate room for new null-terminated string.
Source position: syspchh.inc line 35
| function strnew( | 
| p: PChar | 
| ):PChar; overload; | 
| p: PWideChar | 
| ):PWideChar; overload; | 
Copies P to the Heap, and returns a pointer to the copy.
Returns Nil if no memory was available for the copy.
| 
 | Copy a null-terminated string | |
| 
 | Dispose of a null-terminated string on the heap. | 
Program Example16; Uses strings; { Program to demonstrate the StrNew function. } Const P1 : PChar = 'This is a PChar string'; var P2 : PChar; begin P2:=StrNew (P1); If P1=P2 then writeln ('This can''t be happening...') else writeln ('P2 : ',P2); StrDispose(P2); end.