Copies a string into another string.
Kernel.bdh
Strcpy( inout sDest : string, in sSource : string ): string;
The string actually copied.
Parameter | Description |
---|---|
sDest | Destination string |
sSource | Source string |
dcltrans transaction TStrcpy var sString1, sString2 : string; sOutput : string; nBuffer1, nBuffer2 : number; begin nBuffer1 := Malloc(100); nBuffer2 := Malloc(100); // copy "Hello world!" message to all strings and buffers Strcpy(sString1, "Hello world!"); Strcpy(sString2, sString1); Strcpy(in nBuffer1, sString1); Strcpy(in nBuffer2, in nBuffer1); Strcpy(sOutput, in nBuffer2); write(sString2); writeln; write(sOutput); writeln; Free(nBuffer1); Free(nBuffer2); end TStrcpy;
Hello world! Hello world!