Re: Binary




"Fons Rave" <fonzzz-at-xs4all-dot-nl> wrote in message
news:449850f8$0$31655$e4fe514c@xxxxxxxxxxxxxxxxx
I can code constants in hex:

const
X = $B01;

But (how) can I code constants in octal and binary ?

Unfortunately Delphi doesn't support binary or octal literals. A shame.

While one cannot write these literals, it is possible to use bit operators
to express such constants.

Const
cBinary = (1 shl 7) or (1 shl 5) or (1 shl 3) or 1;
cOctal = (2 shl 6) or (5 shl 3) or 1;

Not pretty, but useful for those that prefer not to translate to hex.


.