function D_Chinese(str:string):string;
var
  s : string;
begin
//〇,一,二
  if str='0' then s :='〇'
  else if str='1' then s :='一'
  else if str='2' then s :='二'
  else if str='3' then s :='三'
  else if str='4' then s :='四'
  else if str='5' then s :='五'
  else if str='6' then s :='六'
  else if str='7' then s :='七'
  else if str='8' then s :='八'
  else if str='9' then s :='九'
  else
  s:=s;
  Result := s;
end;function Time_Change(tm : string):string;//日期转换
var
  m,mm:string;
  i,lg:integer;
begin
  mm:='';
  lg:=length(tm);
  for i:=0 to lg-1 do
  begin
    m:=D_Chinese(Copy(tm,i,i));
    mm:=mm+m;
  end;
  mm:=mm;
  Result :=mm;end;

解决方案 »

  1.   


    http://topic.csdn.net/u/20101011/10/87aba92a-0a7f-4c0e-92f9-13cbd57aeed8.html
      

  2.   

    function D_Chinese(str:string):string;
    var
      s : string;
    begin
    //〇,一,二
      if str='0' then s :='〇'
      else if str='1' then s :='一'
      else if str='2' then s :='二'
      else if str='3' then s :='三'
      else if str='4' then s :='四'
      else if str='5' then s :='五'
      else if str='6' then s :='六'
      else if str='7' then s :='七'
      else if str='8' then s :='八'
      else if str='9' then s :='九'
      else
      s:=s; // 改为s := str;
      Result := s;
    end;function Time_Change(tm : string):string;//日期转换
    var
      m,mm:string;
      i,lg:integer;
    begin
      mm:='';
      lg:=length(tm);
      for i:=0 to lg-1 do
      begin
       m:=D_Chinese(Copy(tm,i,i)); //m:=D_Chinese(Copy(tm,i,1));
       mm:=mm+m;
      end;
      mm:=mm; //可以不用写
      Result :=mm;end;
      

  3.   

    这么费劲干吗,直接用tm[i]就行了
      

  4.   

    1. 数字转汉字的函数里 s:=s; 改为 s := str;
    2. 日期转换函数里 m:=D_Chinese(Copy(tm,i,i)); COPY的最后的参数应该是1,改为 m:=D_Chinese(Copy(tm,i,1));
       同3楼,string类型是可以直接使用下标进行访问的,string下标从1开始。for i:= 1 to lg do
    begin
      m := D_Chinese(tm[i]);
      mm:= mm+m;
    end;
    3. 楼主,要养成自己检查错误的习惯,有什么错的地方,可以跟踪一下代码看看,然后仔细得看看你的代码的每个字符是不是你想要的。