Re: how to enter binary number in Delphi





On Oct 30, 3:08 pm, "cyrille de Brebisson" <cyri...@xxxxxx> wrote:
hello,

how can I write this code:
case a of
  $01000100: begin end;
  $01010100: begin end;
end;

etc where the nubmers are BINARY, not decimal, not hex, but binary, without
having to convert them myself (ie: the equivalent of the C 0b01001001)


AFAIK Delphi has no native binary type, nor any translation functions.
Are you sure you need a binary value. Or are you using something which
can be implemented as a set. Sets certainly produce clearer code.

Of course a BinStrToInt is a fairly simple function to code.

Alan Lloyd

.



Relevant Pages

  • Re: how to enter binary number in Delphi
    ... $01000100: begin end; ... etc where the nubmers are BINARY, not decimal, not hex, but binary, without ... AFAIK Delphi has no native binary type, nor any translation functions. ... Alan Lloyd ...
    (alt.comp.lang.borland-delphi)
  • Re: how to enter binary number in Delphi
    ... cyrille de Brebisson wrote: ... etc where the nubmers are BINARY, not decimal, not hex, but binary, without having to convert them myself ...
    (alt.comp.lang.borland-delphi)
  • Re: how to enter binary number in Delphi
    ... etc where the nubmers are BINARY, not decimal, not hex, but binary, without ... where F is a function that takes a byte A with the binary pattern that ... bits before each bit of A, and write your case constants in Hex. ... clpdmFAQ; ...
    (alt.comp.lang.borland-delphi)
  • Re: how to enter binary number in Delphi
    ... etc where the nubmers are BINARY, not decimal, not hex, but binary, ... There is no direct equivalent of C's 0b01001001 but would the following ...
    (alt.comp.lang.borland-delphi)