comp.lang.ada
 help / color / mirror / Atom feed
* Strings and errors... (gnat)
@ 2006-11-29 17:30 tr00per
  2006-11-29 17:44 ` Robert A Duff
  2006-12-01  8:39 ` Martin Krischik
  0 siblings, 2 replies; 10+ messages in thread
From: tr00per @ 2006-11-29 17:30 UTC (permalink / raw)


Hello!
During compilation GNAT says:
pracownicy.adb:123:22: warning: too few elements for subtype of
"Standard.String" defined at line 107
pracownicy.adb:123:22: warning: "Constraint_Error" will be raised at
run time
(and it is raised at run time)

Those lines look like that:
...
104: 		buf:string(1..70);
...
107: 		tmp:string(1..30);
...
123: 		tmp:=buf(13..26);
...

123:22 is after :=
I don't get the point. Where is the problem? Please help!




^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: Strings and errors... (gnat)
@ 2006-11-29 17:57 Benjamin Place
  2006-11-30  6:16 ` Jeffrey R. Carter
  0 siblings, 1 reply; 10+ messages in thread
From: Benjamin Place @ 2006-11-29 17:57 UTC (permalink / raw)
  To: tr00per, comp.lang.ada

tmp is defined as 30 characters long - you've tried to assign a 14 character string to it.

You need to pad tmp with 16 more characters. Or use Unbounded strings (Ada.Strings.Unbounded).

HTH,
Ben

----- Original Message ----
From: tr00per <tr00per@o2.pl>
To: comp.lang.ada@ada-france.org
Sent: Wednesday, November 29, 2006 12:30:31 PM
Subject: Strings and errors... (gnat)

Hello!
During compilation GNAT says:
pracownicy.adb:123:22: warning: too few elements for subtype of
"Standard.String" defined at line 107
pracownicy.adb:123:22: warning: "Constraint_Error" will be raised at
run time
(and it is raised at run time)

Those lines look like that:
...
104:         buf:string(1..70);
...
107:         tmp:string(1..30);
...
123:         tmp:=buf(13..26);
...

123:22 is after :=
I don't get the point. Where is the problem? Please help!

_______________________________________________
comp.lang.ada mailing list
comp.lang.ada@ada-france.org
http://www.ada-france.org/mailman/listinfo/comp.lang.ada






^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2006-12-01 19:39 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-29 17:30 Strings and errors... (gnat) tr00per
2006-11-29 17:44 ` Robert A Duff
2006-11-29 17:57   ` tr00per
2006-11-29 18:10     ` Ludovic Brenta
2006-11-30 11:36       ` Georg Bauhaus
2006-11-30  2:04   ` jimmaureenrogers
2006-12-01  8:39 ` Martin Krischik
2006-12-01 19:39   ` [solved] tr00per
  -- strict thread matches above, loose matches on Subject: below --
2006-11-29 17:57 Strings and errors... (gnat) Benjamin Place
2006-11-30  6:16 ` Jeffrey R. Carter

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