Julien REINAULD
Guest
Wed Jul 13, 2011 2:54 pm
Hi all!
According to std.standard:
TYPE string IS ARRAY ( positive RANGE <> OF character);
"hello" is a valid string litteral
"" is a valid string litteral too, it is the empty string.
Let
TYPE foo IS ARRAY ( positive RANGE <> OF integer);
(0, 1, 1, 2, 3, 5) is a valid foo litteral
What is the litteral for an empty foo?
Thx
Julien
Tricky
Guest
Wed Jul 13, 2011 3:25 pm
On Jul 13, 1:54 pm, Julien REINAULD <julien.reina...@gmail.com> wrote:
Quote:
Hi all!
According to std.standard:
TYPE string IS ARRAY ( positive RANGE <> OF character);
"hello" is a valid string litteral
"" is a valid string litteral too, it is the empty string.
Let
TYPE foo IS ARRAY ( positive RANGE <> OF integer);
(0, 1, 1, 2, 3, 5) is a valid foo litteral
What is the litteral for an empty foo?
Thx
Julien
That is an interesting question.
You can make a null constant like this:
constant NULL_FOO : foo(1 downto 2) := (others => 0);
then use the constant in place of a literal.
Alan Fitch
Guest
Mon Jul 18, 2011 11:09 pm
On 13/07/11 14:25, Tricky wrote:
Quote:
On Jul 13, 1:54 pm, Julien REINAULD <julien.reina...@gmail.com> wrote:
Hi all!
According to std.standard:
TYPE string IS ARRAY ( positive RANGE <> OF character);
"hello" is a valid string litteral
"" is a valid string litteral too, it is the empty string.
Let
TYPE foo IS ARRAY ( positive RANGE <> OF integer);
(0, 1, 1, 2, 3, 5) is a valid foo litteral
What is the litteral for an empty foo?
Thx
Julien
That is an interesting question.
You can make a null constant like this:
constant NULL_FOO : foo(1 downto 2) := (others => 0);
then use the constant in place of a literal.
I haven't tried it, or looked it up in the LRM, but I imagine you may be
able to use
(1 downto 2 => 0)
though of course a named constant is nicer.
regards
Alan
--
Alan Fitch