unit Unit1;interfaceuses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;type
  TForm1 = class(TForm)
    Edit1: TEdit;
    Button1: TButton;
    Label1: TLabel;
    Label2: TLabel;
   
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;var
  Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
  type
  tvowels=set of char;
 var
     vowels:tvowels;
begin
 vowels:=['a','e','i','o','u'];
 if edit1.text[1] in vowels then
 lable2.Caption:='是元音';
 else
 lable2.Caption:='请再试';
 
end;end.

解决方案 »

  1.   

    pazee(耙子) ( ) 老大又来了
      

  2.   

    你的程序对了,只是将  lable2.Caption:='是元音';这句后的 ';'号去掉就可以了
      

  3.   

    呵呵,同意haoco,又一个初心大意的人
      

  4.   

    else前是不用加分号的!!!你运行的时应该会报错的啊!!!
      

  5.   

    我这不是随便写的Unit1 in 'Unit1.pas' {Form1};lable2.Caption:='是元音' lable2.Caption:='请再试'; 
    这几句报错,请大家指导一下,
      

  6.   

    procedure TForm1.Button1Click(Sender: TObject);
      type
      tvowels=set of char;
     var
         vowels:tvowels;
    begin
     vowels:=['a','e','i','o','u'];
     if edit1.text[1] in vowels then
     lable2.Caption:='是元音'
     else
     lable2.Caption:='请再试';
     
    end;
      

  7.   

    procedure TForm1.Button1Click(Sender: TObject);
      type
      tvowels=set of char;
     var
         vowels:tvowels;
    begin
     vowels:=['a','e','i','o','u'];
     if edit1.text[1] in vowels then
     label2.Caption:='是元音'
     else
     label2.Caption:='请再试';
     
    end;