Re: how to enter binary number in Delphi
- From: Jim P <Jim_P@xxxxxxxxxxxxxxxxx>
- Date: Mon, 30 Oct 2006 15:06:38 -0800
alanglloyd@xxxxxxx wrote:
But does the case statement require the cases to be constants?
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
Of course a constand can be defined that matched the binary pattern
and maybe have a meaningful name - - -
Jim P.
.
- References:
- how to enter binary number in Delphi
- From: cyrille de Brebisson
- Re: how to enter binary number in Delphi
- From: alanglloyd@xxxxxxx
- how to enter binary number in Delphi
- Prev by Date: Re: how to enter binary number in Delphi
- Next by Date: Re: how to enter binary number in Delphi
- Previous by thread: Re: how to enter binary number in Delphi
- Next by thread: Re: how to enter binary number in Delphi
- Index(es):