if strtoint(trim(edit1.text))/2 <> ... then begin messagebox(0,'每场副数过于,应该小于16!','错误',mb_ok+mb_iconerror); abort; end;
大家帮帮忙。
----------------------------------------------
Function IThink(Boy,Girl : TPerson) : String; begin if Boy.钱 < 10W then Girl.Say(''滚!'') else begin if Girl.Anser = ''我愿意'' then Result := ''结婚'' else Result := IntToStr(88); end; 风过不折→百炼成尧 QQ: 7315910
用mod的代码怎么写呢?: if (strtoint(trim(edit1.text)) mod 2 <>0 then begin showmessag('只能输入偶数'); abort; end;
这样是错的啊。。
----------------------------------------------
Function IThink(Boy,Girl : TPerson) : String; begin if Boy.钱 < 10W then Girl.Say(''滚!'') else begin if Girl.Anser = ''我愿意'' then Result := ''结婚'' else Result := IntToStr(88); end; 风过不折→百炼成尧 QQ: 7315910
我还没的运行呢,是代码错误啊,大家帮我试一下嘛。。
----------------------------------------------
Function IThink(Boy,Girl : TPerson) : String; begin if Boy.钱 < 10W then Girl.Say(''滚!'') else begin if Girl.Anser = ''我愿意'' then Result := ''结婚'' else Result := IntToStr(88); end; 风过不折→百炼成尧 QQ: 7315910
应该是这样的,我帮你调试通过了,操作系统:window2000 语言:delphi6.0企业版(其他不用我说吧) if (strtoint(trim(edit1.text)) mod 2) <>0 then begin showmessage('只能输入偶数'); end else ..... 注:你应该再进行一下文本框的输入检验。
----------------------------------------------
-