unit UpCase;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Edit1: TEdit;
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

// BeginExample: UpCase
// Routine: System.UpCase

// BeginCode
{
The following code uppercases every other character in the
text of an edit control when the user clicks the button.
}
procedure TForm1.Button1Click(Sender: TObject);
var
  s : string;
  i : Integer;
begin
  { Get string from TEdit control }
  s := Edit1.Text;
  for i := 1 to Length(s) do
    if i mod 2 = 0 then s[i] := System.UpCase(s[i]);
  Edit1.Text := s;
end;
// EndCode
// EndExample: UpCase
end.
