Home > Back-end >  C # code into the Delphi code, please help
C # code into the Delphi code, please help

Time:09-20

C # code:

Public static bool ReadPort (int nPort)
{
Int nState=0;
Int Ret.
Ret=__ReadPort (ref nState);
If (((nState & gt;> NPort) & amp; 0 x01) & gt; 0), the key is the conversion to Delphi is how to write, 0 x01 is hexadecimal
return true;
The else
return false;

}

CodePudding user response:

Up, his top

CodePudding user response:

Is an operator? Don't understand the profound

CodePudding user response:

Yes, where is the master?

CodePudding user response:

If (((nState & gt;> NPort) & amp; 0 x01) & gt; 0)
Delphi written
If ((nState SHR nPort) and $01) & gt; 0 then

CodePudding user response:

Help, look at what the operator, the operator use Delphi to replace is ok

CodePudding user response:

Public static bool ReadPort (int nPort)
{
Int nState=0;
Int Ret.
Ret=__ReadPort (ref nState);
If (((nState & gt;> NPort) & amp; 0 x01) & gt; 0), the key is the conversion to Delphi is how to write, 0 x01 is hexadecimal
return true;
The else
return false;

}

The function ReadPort (port: Integer);
Var
NState: Integer;
Ret: Integer;
The begin
Ret:=_ReadPort (nState);
Result:=((nState SHR port) and $1) & gt; 0;
end;
  • Related