c#代码转为delphi代码,请高手帮忙

ZXYSOSO 2016-09-06 07:56:18
c#代码:

public static bool ReadPort(int nPort)
{
int nState=0;
int Ret;
Ret=__ReadPort(ref nState);
if (((nState >>nPort) &0x01) >0) --关键是这段转换成delphi 是怎样写的,0x01是16进制
return true;
else
return false;

}
...全文
1490 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
ICMGDCHN 2017-01-14
  • 打赏
  • 举报
回复
public static bool ReadPort(int nPort) { int nState=0; int Ret; Ret=__ReadPort(ref nState); if (((nState >>nPort) &0x01) >0) --关键是这段转换成delphi 是怎样写的,0x01是16进制 return true; else return false; } function ReadPort(port:Integer); var nState:Integer; Ret:Integer; begin Ret := _ReadPort(nState); result := ((nState shr port) and $1)>0; end;
dai78 2016-11-28
  • 打赏
  • 举报
回复
看帮助,看那是什么操作符,就用Delphi中的操作符替换就可以了
码农精神 2016-11-24
  • 打赏
  • 举报
回复
if (((nState >>nPort) &0x01) >0) delphi 写法 if ( (nState shr nPort) and $01)>0 then
ZXYSOSO 2016-09-06
  • 打赏
  • 举报
回复
是啊,高手在哪里?
三樱椒 2016-09-06
  • 打赏
  • 举报
回复
是 位操作符吗? 不懂 高深
ZXYSOSO 2016-09-06
  • 打赏
  • 举报
回复
up,自己顶一下

16,748

社区成员

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

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