RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
WideStrUtils.WStrLCopy Function

Copies up to a specified maximum number of characters from a PWideChar.

Pascal
function WStrLCopy(Dest: PWideChar; const Source: PWideChar; MaxLen: Cardinal): PWideChar;
C++
PWideChar WStrLCopy(PWideChar Dest, const PWideChar Source, unsigned MaxLen);

WStrLCopy copies at most MaxLen characters from Source to Dest, then adds a null terminator to Dest and returns it. The SizeOf standard function (Delphi) or the sizeof operator (C++) can be used to determine the MaxLen parameter. Usually, MaxLen equals ((SizeOf(Dest) div 2) - 1.

Note: WStrLCopy copies a null terminator as well as MaxLen characters. Be sure that Dest is large enough to accommodate the null terminator at the end.
 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!