var
   sMonth,sDay : string;
   sCurYear,sCurMonth,sCurDay,sCurWeek : Word;
begin
  decodedate(Now,sCurYear,sCurMonth,sCurDay);  GetMonthAndDay(sMonth,sDay,'5月2号');  //这个过程是从字符串中分离出数字
  if (sDay=sCurDay) and (sMonth=sCurMonth) then    //这样作行不通。
    ....
end;

解决方案 »

  1.   

    if (sDay=sCurDay) and (sMonth=sCurMonth) then    //这样作行不通。
    ====>
    if (sDay=Pchar(sCurDay)) and (sMonth=Pchar(sCurMonth)) then
      

  2.   

    将整型转换为字符串再比较:
    if (sDay=inttostr(sCurDay)) and (sMonth=inttostr(sCurMonth)) then
      

  3.   

    to : fw0011(ANGE )
    你的方法会出现地址错误
    to : fengzhengren(风筝) 
    我就是用这个方法作的。
      

  4.   

    能给出GetMonthAndDay(sMonth,sDay,'5月2号');  的代码吗???
    可能会是哪里的问题...
      

  5.   

    fengzhengren(风筝)的方法没有问题的,主要是怕你在处理GetMonthAndDay(sMonth,sDay,'5月2号'); 的时候,sMonth和sDay里面带进去了无用的数据...
      

  6.   

    sDay:string;
    sCurDay:word;
    sDay=sCurDay,这样行的通才怪 楼主肯定C学的不错,呵呵改成if strtoint(sday)=sCurDay then ...试试
      

  7.   

    if (StrToInt(sDay)=sCurDay) and (StrToInt(sMonth)=sCurMonth) then