{
StrEnd example
The following example uses an edit control, a label, and a button on a form. When the button 
is clicked, the edit control’s text is copied into a buffer. Then the buffer is displayed 
backwards in the label.
} 
procedure TForm1.Button1Click(Sender: TObject);
var
  TextBuffer: PChar;
  Ptr: PChar;
begin
  GetMem(TextBuffer, Length(Edit1.Text)+1);
  StrCopy(TextBuffer, PChar(Edit1.Text));
  Ptr := StrEnd(TextBuffer);
  Label1.Caption := '';
  while Ptr >= TextBuffer do
  begin
    Ptr := Dec(Ptr);
    Label1.Caption := Label1.Caption + Ptr^;
  end;
  FreeMem(TextBuffer);
end; 
