对于一个字节 如何获得它全部的8位的信息,能否显示其内容
解决方案 »
- 请教下 TdxDBtreelist 如何获取多选? 100给你
- 今天上午CSDN又抽了吗?(顺便散分)
- 我又有问题了,无奈呀(在线等答案)
- 各位cs侠,请看我的另类问题系列(一)--About table TQuery and dbgrid
- 提问:关于quickrep的简单问题?
- 关于开发传奇外挂。
- 深度探索DBGrid问题,想必大家都用到这个哈,来者有分!周末散分了哈~~~~~
- 整样变掉窗口标题的字体?
- SQL Server 数据库中字段内容为NULL的处理办法?
- 想找两个人一起做个共享软件,有人有兴趣吗?
- 程序编译时出现cannot debug project unless a host application is defined.
- 基类中有个属性是protected
var
a: byte;
function DecToBinStr(n: integer): string;
var
S: string;
i: integer;
Negative: boolean;
begin
if n < 0 then
Negative := true
else
Negative := False; 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); //remove leading zeros
if Negative then
S := '-' + S;
Result := S;
end;begin
a := 255;
showmessage(DecToBinStr(a));
end;