Delphi Programming RTL Reference|By Category|Alphabetically|By Unit
procedure SetString(var S: string; c : PChar; Length: Integer);
Sets the lenght and contents of a given string.
SetString procedure sets the length of string S to Length, then copies Length characters from c to the string.
var s : string;
c : array[0..MAX_COMPUTERNAME_LENGTH] of char;
i : integer;
i:=GetComputerName(c, SizeOf(c))
SetString(s,c,i);
//s=computer name;
|
String Types in Delphi
Understanding and managing string data types in Delphi's Object Pascal. Learn about differences between Short, Long, Wide and null-terminated strings.
|
Free Delphi code snippet inside every Delphi Newsletter! |
|
|
|
Got some code to share? Got a question? Need some help? |
|
|