comp.lang.ada
 help / color / mirror / Atom feed
From: Dale Stanbrough <dale@cs.rmit.edu.au>
Subject: Re: Get_Line vs Adasockets
Date: 2000/08/13
Date: 2000-08-13T00:00:00+00:00	[thread overview]
Message-ID: <dale-978440.09065214082000@news-server> (raw)
In-Reply-To: 8n6cbc$9ge$1@news.tpi.pl

In article <8n6cbc$9ge$1@news.tpi.pl>, "Ultor" <ultor@hert.org> wrote:

> Hello
> 
> I'm new in ADA (code since Friday). I got a problem with Get_Line in my
> source. I tried to make it working over 2 hours and still got a problem 
> with
> that.
> 
> When i did Get_Line like this
> 
>    BUF := Get_Line(Incoming_Socket);
> 
> then I had problem with CONSTRAINT_ERROR. I don't know how to set size of
> BUF to be the same as line from Get_Line (as I know that should eliminate
> CONSTRAINT_ERROR).
> 
> I would be very gratefull if some1 could correct my source.

if you assign one array to another, and they are not the same length you 
get a constraint error.



[stuff deleted]
> 
>         Get_Line(Incoming_Socket,Buf,Buf'Size);
>         if BUF(1..Buf'Length)="QUIT"


this will -never- work because a 500 character string can never equal a 
4 char string.

try  
   if Buf (1..4) = "QUIT" then





...and i can't see a return statement in your function.


Dale




  reply	other threads:[~2000-08-13  0:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-08-13  0:00 Get_Line vs Adasockets Ultor
2000-08-13  0:00 ` Dale Stanbrough [this message]
2000-08-14  0:00   ` Martin Dowie
2000-08-17  0:00     ` tmoran
2000-08-21  0:00       ` Martin Dowie
2000-08-14  0:00 ` Anders Gidenstam
2000-08-14  0:00 ` Ken Garlington
2000-08-14  0:00   ` Ultor
2000-08-14  0:00     ` Ted Dennison
2000-08-14  0:00       ` Michal Zalewski
2000-08-14  0:00         ` Ted Dennison
2000-08-21  1:44   ` David Thompson
replies disabled

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