On 3/25/20 2:17 PM, Sven Barth via fpc-pascal wrote:
wkitt...@windstream.net schrieb am Mi., 25. März 2020, 18:47:

hummm... ok, so how to you get a constant to be a byte and storing 7 for the
decimal value?


The compiler normally uses the smallest possible type that can represent the value. You can force it however by using e.g.

const
   MyConst = Word(42);


ok... so in the situation this thread is covering:

const
  foldhiddenbit = byte(7);
  foldhiddenmask = byte(1 shl foldhiddenbit);
  currentfoldhiddenbit = byte(6);
  currentfoldhiddenmask = byte(1 shl currentfoldhiddenbit);
  foldlevelmask = byte(not (foldhiddenmask or currentfoldhiddenmask));

is the way to do it?

or are you saying that you cannot use a typed constant in the init of another
(typed) constant?

Correct.


strange...

[wargames] seems like the winning move is to not play the game. [/wargames] LUL


--
 NOTE: No off-list assistance is given without prior approval.
       *Please keep mailing list traffic on the list where it belongs!*
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to