dormky 2 Posted October 28 const TT = $FFFF; TTARRAY = [$FFFF]; The second line gets "E1012 Constant expression violates subrange bounds", but it's functionally the same as the first one. Is the compiler just dumb or do I need to write this in another syntax ?  The actual use case is an array of const TColor. Thanks 🙂 Share this post Link to post
Uwe Raabe 2057 Posted October 28 Despite its name the TTARRAY declaration is a set and not an array, but sets are limited to elements with ordinal 0..255. 1 Share this post Link to post
dormky 2 Posted October 28 Alright, got it. Still cannot work with TColor but it's better then nothing, example : // The highlight colors here are defined twice so the compiler doesn't complain. YELLOW: TColor = $00BBFF; BLUE: TColor = $F0CF89; HIGHLIGHT_COLORS: array[0..1] of TColor = ($00BBFF, $F0CF89); Thanks ! Share this post Link to post
Lajos Juhász 293 Posted October 28 (edited) I have no problem to compile it:  const // The highlight colors here are defined twice so the compiler doesn't complain. YELLOW = $00BBFF; BLUE = $F0CF89; HIGHLIGHT_COLORS: array[0..1] of TColor = (YELLOW, BLUE); You can also compile:  const // The highlight colors here are defined twice so the compiler doesn't complain. YELLOW = TColor($00BBFF); BLUE = TColor($F0CF89); HIGHLIGHT_COLORS: array[0..1] of TColor = (YELLOW, BLUE);  Edited October 28 by Lajos Juhász Share this post Link to post