V
valentin tihomirov
Guest
This code is accepted
type TLETTERS is array (0 to 1) of CHARACTER;
constant LETTERS: TLETTERS := ('a', 'b');
however the following is not
type TLETTERS is array (0 to 0) of CHARACTER;
constant LETTERS: TLETTERS := ('a');
IMO, this is called inconsistency (bad design).
BTW, is there a more compact (single line) way to declare a constant array
avoiding the type declaration? I guess the long preparations creating
templates (which are types in this case) are necessary for instantiating
multiple objects using this template. But I have only one array, so what is
the need to declare a special type for it? In C, we can instantiate an array
of any elements avoiding developement of special array classes for each
basic element. Am I missing something?
type TLETTERS is array (0 to 1) of CHARACTER;
constant LETTERS: TLETTERS := ('a', 'b');
however the following is not
type TLETTERS is array (0 to 0) of CHARACTER;
constant LETTERS: TLETTERS := ('a');
IMO, this is called inconsistency (bad design).
BTW, is there a more compact (single line) way to declare a constant array
avoiding the type declaration? I guess the long preparations creating
templates (which are types in this case) are necessary for instantiating
multiple objects using this template. But I have only one array, so what is
the need to declare a special type for it? In C, we can instantiate an array
of any elements avoiding developement of special array classes for each
basic element. Am I missing something?