delphi DecToBinStr


本文整理自网络,侵删。

 
function DecToBinStr(N: Integer): string;
var
  S: string;
  i: Integer;
  Negative: Boolean;
begin
  Negative := False;
  if N < 0 then Negative := True;
  N := Abs(N);
  for i := 1 to SizeOf(N) * 8 do
  begin
    if N < 0 then S := S + '1'
    else S := S + '0';
    N := N shl 1;
  end;
  Delete(S, 1, Pos('1', S) - 1);
  if Negative then S := '-' + S;
  Result := S;
end;

相关阅读 >>

Delphi通过spcomm com口发短信包括pud编码解码

Delphi high 返回数组下标的最大值

Delphi运行时拖拉、改变元件大小

Delphi 释放资源文件

如何让dbgrid显示序号?

Delphi 10.3.3 启动cnpack ide 专家 cnwizards coreide260.bpl错误解决办法

Delphi 在窗体上创建自己的光标并输入文字

Delphi xe5 安卓设置屏幕横屏竖屏

Delphi webservices传base64字串

Delphi ip编辑控件

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...

    正在狠努力加载,请稍候...