comp.lang.ada
 help / color / mirror / Atom feed
From: Kevin Chadwick <kevc3no4@gmail.com>
Subject: Re: Empty String confusion; Positive and Natural
Date: Tue, 30 Nov 2021 04:17:19 -0800 (PST)	[thread overview]
Message-ID: <eac0b8bd-7f64-4909-b0d3-7730bc86a1efn@googlegroups.com> (raw)
In-Reply-To: <so4snd$s9c$1@dont-email.me>

I have a create function that returns a type RunOutput

I always get range check failed even with a string of multiple characters.

type RunOutput(LogLen, OutputLen : Natural) is record
           LogStr : String(0..LogLen);
           Output : String(0..OutputLen);
...
end record;

I did have the following which works, so long as the string is not empty

type RunOutput(LogLen, OutputLen : Positive) is record
           LogStr : String(1..LogLen);
           Output : String(1..OutputLen);
...
end record;


P.s. I am not using exceptions with messages for log strings because I would rather use features that work with the zero footprint runtime as much as possible, where it makes sense.

  reply	other threads:[~2021-11-30 12:17 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-29 17:34 Empty String confusion; Positive and Natural Kevin Chadwick
2021-11-29 18:05 ` Jeffrey R.Carter
2021-11-29 19:19 ` Niklas Holsti
2021-11-29 22:50   ` Kevin Chadwick
2021-11-30  8:29     ` Simon Wright
2021-11-30  8:34     ` Niklas Holsti
2021-11-30 10:00     ` Jeffrey R.Carter
2021-11-30 12:17       ` Kevin Chadwick [this message]
2021-11-30 12:54         ` J-P. Rosen
2021-11-30 13:12           ` Kevin Chadwick
2021-11-30  7:40 ` ldries46
2021-11-30  8:21   ` Simon Wright
2021-11-30 12:39     ` ldries46
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox