在edit1中填的数据一定是9位,如果不是就提示:
if edit1.Text=''or length(trim(edit1.text))<> 9 then
  showmessage('代码为9位,请修改!')lengh的用法对不对?