ifthen如何使用?------------(一小时内结贴)

xiyixiaowm50 2004-12-03 11:11:33
写在程序里系统总提示没有定义,而这个东东本来就是系统的呀.
...全文
136 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
nyf1220 2004-12-06
  • 打赏
  • 举报
回复
我已经查出了要用maths单元才可以用ifthen?!!!!!!!!!!!!!!!

楼主的这个帖子真搞笑哦,,
xiyixiaowm50 2004-12-05
  • 打赏
  • 举报
回复
不好意思,昨天晚上机器在发贴一小时内中毒了,今天重装的系统。我已经查出了要用maths单元才可以用ifthen,不过还是感谢各位。
sxtdxvb 2004-12-05
  • 打赏
  • 举报
回复
呵呵,你这也叫1小时结帖??
sxtdxvb 2004-12-04
  • 打赏
  • 举报
回复
^_^,被我逮住了!

看这个

代码:

var
a,b:integer;
begin
min:=ifthen(a<b,1,2);
end;

结果为1!
ntn115 2004-12-04
  • 打赏
  • 举报
回复
richard_ouyang 2004-12-04
  • 打赏
  • 举报
回复
USES MathStrUtils;
dext 2004-12-04
  • 打赏
  • 举报
回复
uses Math;

function IfThen(AValue: Boolean; const ATrue: Integer; const AFalse: Integer): Integer;
begin
if AValue then
Result := ATrue
else
Result := AFalse;
end;

function IfThen(AValue: Boolean; const ATrue: Int64; const AFalse: Int64): Int64;
begin
if AValue then
Result := ATrue
else
Result := AFalse;
end;

function IfThen(AValue: Boolean; const ATrue: Double; const AFalse: Double): Double;
begin
if AValue then
Result := ATrue
else
Result := AFalse;
end;
ICMGDCHN 2004-12-04
  • 打赏
  • 举报
回复
不好意思,不知道有IfThen这个函数

刚查了下,可能是你忘记USES MathStrUtils了吧
fsybaby 2004-12-04
  • 打赏
  • 举报
回复
USES MathStrUtils

这是个附加的库函数
nyf1220 2004-12-03
  • 打赏
  • 举报
回复
晕死哦,快到一个小时了,赶紧来蹭分!
查帮助
输入if,你就会看到一切了

也就是类似与楼上写的
ICMGDCHN 2004-12-03
  • 打赏
  • 举报
回复
ifthen?连起来写???刚从VB转过来的??

只有if (表达式) then
...

if (表达式) then
...
else if (表达式) then
...


if (表达式) then
...
else
...

三种

16,748

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 语言基础/算法/系统设计
社区管理员
  • 语言基础/算法/系统设计社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧