if Length(trim(dbEdit1.Text))<>8  then
    smd1.Caption := '系统提示';
   smd1.Text:= '输入的"学号"格式必须是8位数字,请重新输入!';
   smd1.ShowModal;
无论输入是不是8位数据,都有提示信息,为什么不进入判断呀!!
把条件改成>,<都是一样的.学号字段是字符型.请指点一下!!

解决方案 »

  1.   

    if Length(trim(dbEdit1.Text))<>8  then
    BEGIN
       smd1.Caption := '系统提示';
       smd1.Text:= '输入的"学号"格式必须是8位数字,请重新输入!';
       smd1.ShowModal;
    END;
      

  2.   

    看来你还是基础没学好,写成泥那样的话相当于:
    if Length(trim(dbEdit1.Text))<>8  then begin
        smd1.Caption := '系统提示';
    end;
    smd1.Text:= '输入的"学号"格式必须是8位数字,请重新输入!';
    smd1.ShowModal;