SysUtilsStrPCopy (Object Pascal)

From Appmethod Code Examples
Jump to: navigation, search

Description

This example requires a button on a form and uses StrPCopy to copy a string into an array and then to display the character array on the form canvas. StrPCopy does not do a length check.

Code

procedure TForm1.Button1Click(Sender: TObject);
var
  A: array[0..79] of Char;
  S: String;
begin
  S := 'Honk if you know Blaise.';
  StrPCopy(A, S);
  Canvas.TextOut(10, 10, string(A));
end;

Uses