comp.lang.ada
 help / color / mirror / Atom feed
From: anon@anon.org (anon)
Subject: Re: Weird string I/O problem
Date: Thu, 04 Dec 2008 22:54:14 GMT
Date: 2008-12-04T22:54:14+00:00	[thread overview]
Message-ID: <qcZZk.174965$Mh5.70884@bgtnsc04-news.ops.worldnet.att.net> (raw)
In-Reply-To: Pine.LNX.4.64.0812040954120.21966@medsec1.medien.uni-weimar.de

And it does work each time it is you run it.  But if you follow the 
code you will see the routine is to be executed only once. The error is in 
making it a multi-usable code. with extra code allowing someone to reset 
the maximun string length. Plus the routine may need to handle BackSpace or 
Del characters and some other control characters.  But like I said there are 
too many student cheating to give a complete example. 

But no one else even gave code.  They just try to BS someone with a 
paragraph that say nothing.  At least in my answer I gave a concept 
and a starting point that any programmer could follow and finish which 
would make the code his.

But I guess except for Adam, Robbert Duff, and myself there are no 
programmer here. Only guys who can try to BS an answer to dead.
To coin a phrase, "Talk is cheat, Code is priceless"!

In <Pine.LNX.4.64.0812040954120.21966@medsec1.medien.uni-weimar.de>, stefan-lucks@see-the.signature writes:
>On Thu, 4 Dec 2008, anon wrote:
>
>> Did I use the "pragma Initialize_Scalars ;" in GNAT.ADC or the command-line 
>> option version of that pragma or did I, as I have said "You do not give the 
>> complete code."
>> 
>> That's something for you to think about!
>
>Well, in the message I replied to, you explicitely called your code a 
>"Full Working Example". I apologise for taking our postings seriously!
>
>> 
>> In <Pine.LNX.4.64.0812031226320.14772@medsec1.medien.uni-weimar.de>, stefan-lucks@see-the.signature writes:
>> >On Wed, 3 Dec 2008, anon wrote:
>> >> -- Build your own input routine.  Example:
>> >[...]
>> >
>> >if the variable Last is not initialised to 0 
>> >   *before* you enter the loop ...
>> >
>> >>   begin
>> >>     Put ( P ) ;
>> >>     input_string := ( others => nul ) ;
>> >>     for index in input_string'Range loop   -- limits data size
>> >>       Get ( char ) ;
>> >>                                   -- Traps both LF or CR/LF type of EOL
>> >>       exit when char = CR or char = LF ; 
>> >
>> >.... and if the user immediately presses the return key 
>> >    (i.e., if you read an empty line), ...
>> >
>> >>       input_string ( index ) := char ;
>> >>       Last := Index ;  
>> >>     end loop ;
>> >>     if char = CR then  -- for CR/LF pairing type of OSs
>> >>       Get ( char ) ;
>> >>     end if ;
>> >>     if char = LF or Last = input_string'Last then -- process EOL on screen
>> >>       New_Line ;
>> >>     end if ;
>> >>     -- valid data is input_string ( 1 .. last ) ; 
>> >>     -- with no term control characters like LF or CR
>> >
>> >.... then Input_String ( 1.. Last ) depends on 
>> >    the uninitialised variable Last ...
>> >
>> >>     return ( input_string ( 1 .. last ) ) ;
>> >
>> >.... and the statement above may raise an exception. 
>> >
>> >>   end get ;
>> >
>> >-- 
>> >------ Stefan Lucks   --  Bauhaus-University Weimar  --   Germany  ------
>> >               Stefan dot Lucks at uni minus weimar dot de
>> >------  I  love  the  taste  of  Cryptanalysis  in  the  morning!  ------
>> >
>> 
>> 
>
>-- 
>------ Stefan Lucks   --  Bauhaus-University Weimar  --   Germany  ------
>               Stefan dot Lucks at uni minus weimar dot de
>------  I  love  the  taste  of  Cryptanalysis  in  the  morning!  ------
>




  reply	other threads:[~2008-12-04 22:54 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-26  5:52 Weird string I/O problem Jerry
2008-11-26  7:24 ` christoph.grein
2008-11-26  7:38   ` christoph.grein
2008-11-26  8:25     ` Dmitry A. Kazakov
2008-11-26  9:07   ` Jean-Pierre Rosen
2008-11-26 15:21     ` John McCormick
2008-11-26 15:56     ` Adam Beneschan
2008-11-27 10:13       ` Jean-Pierre Rosen
2008-12-01 16:17         ` Adam Beneschan
2008-11-27  4:46 ` Jerry
2008-11-27 10:27   ` Jean-Pierre Rosen
2008-12-01 19:47 ` anon
2008-12-02  5:44   ` christoph.grein
2008-12-02  6:55     ` anon
2008-12-02  7:53       ` christoph.grein
2008-12-02 16:39         ` Adam Beneschan
2008-12-03  9:16           ` anon
2008-12-03 10:42             ` christoph.grein
2008-12-03 12:21               ` John B. Matthews
2008-12-04  0:15               ` anon
2008-12-04  7:31                 ` christoph.grein
2008-12-04  7:56                   ` Ludovic Brenta
2008-12-04  8:46                     ` Georg Bauhaus
2008-12-03 11:35             ` stefan-lucks
2008-12-04  0:27               ` anon
2008-12-04  8:58                 ` stefan-lucks
2008-12-04 22:54                   ` anon [this message]
2008-12-05  9:06                     ` Georg Bauhaus
replies disabled

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