comp.lang.ada
 help / color / mirror / Atom feed
From: "JJ Lallemand" <jjlallemand@hol.fr>
Subject: Using STRING variable
Date: 1998/05/20
Date: 1998-05-20T00:00:00+00:00	[thread overview]
Message-ID: <6jv9mg$e7c$1@news4.isdnet.net> (raw)


Hi,

First, sorry for my 'bad english' !

I am new in programming in ADA (ADA 95) and I have a little problem with
string var.


Here is a little program :


----------------------
with text_io; use text_io;

procedure main is
zz : string(1..20);
begin
   put(item=>"Enter your name: ");
   get(zz);
   put_line("hello " & zz);
end main;
-----------------------

The problem is that ADA wants exactly 20 characters ! How to enter less
characters ?

And when I "put" a string to an other ( text2 := text1 ) with  text1 :
string (1..20) and text2 : string(1..30), ADA raises a "constraint error"


Thank you for your help !

JJ







             reply	other threads:[~1998-05-20  0:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-05-20  0:00 JJ Lallemand [this message]
1998-05-20  0:00 ` Using STRING variable Dale Keim
1998-05-21  0:00   ` John McCabe
1998-05-21  0:00 ` Using STRING variable (in French) Jean-Pierre Rosen
replies disabled

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