empty array litteral

J

JR

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
 
T

Tricky

> Hi all!
> 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.
> 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?
> 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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top