comp.lang.ada
 help / color / mirror / Atom feed
From: Anh Vo <anhvofrcaus@gmail.com>
Subject: Re: Re-write a file in Ada
Date: Fri, 8 Jan 2016 14:08:46 -0800 (PST)
Date: 2016-01-08T14:08:46-08:00	[thread overview]
Message-ID: <43bc5562-18e9-451d-b7ce-7c050c41c2f6@googlegroups.com> (raw)
In-Reply-To: <n6p9bf$r02$1@loke.gir.dk>

On Friday, January 8, 2016 at 1:22:57 PM UTC-8, Randy Brukardt wrote:
> <comicfanzine@gmail.com> wrote in message 
> news:77e47c8b-7dcc-4e86-8f89-1f348cdf08dd@googlegroups.com...
> > Hello everybody ,
> >
> > Next , a working code which re-write entirely a file .
> >
> > I would like to modify it , doing the same thing exept that :
> >
> > Undounded_strings will be generate every time there is a next line .
> >
> > Then , several get_line will be done on those strings .
> >
> > And in final , put those modified strings in the file .
> >
> >
> > Anyone knows how to code that ?
> 
> I'm sure most of us can code whatever we need, and the above seems trivial. 
> But most of us are also professional programmers, either working in Ada or 
> working in some other language and doing hobby projects in Ada. We're happy 
> to help, but being pros has two effects:
> 
> (1) We're not interested in writing other people's programs for them. We'll 
> help people learn, but that's very different.
> (2) One of the first things that professional programmers learn is that the 
> hardest thing to do is to debug someone else's code.
> 
> On top of which, you gave code (which is good), but you never explained (in 
> detail!) what happens compared to what you expect. Given that, the only 
> serious alternative is to spend a hour or more figuring out what you're 
> trying to do and then create a program (from scratch) that does that. I 
> suspect most everyone here has something better to do than that. (The only 
> time I'd do this is if I find the problem is interesting, which certainly is 
> not the case here.)
> 
> I, personally, rarely look at the code posted here; I provide help based on 
> the error and then work backwards from there. Since you didn't provide the 
> error, and I'm surely not going try to load and compile your code, attempt 
> to figure out what data you are reading, whether the results I get make any 
> sense, and so on.
> 
> I'd suggest telling us what results you are getting from your code and what 
> you are expecting, and perhaps someone will want to help you (but no 
> promises).

I agreed 100% with Randy. 

Tell me if I understood you correctly. You wanted to read text in your source text (main.adb) one line at time. Then, they are concatenated into a single line of text for entire file. For example, if there are two lines of text, as shown below, the result would be one line of text as shown in the bottom.

with Ada.Text_IO.Unbounded_IO ;  use Ada.Text_IO.Unbounded_IO ;
with Ada.Strings.Unbounded ;  use Ada.Strings.Unbounded ;

with Ada.Text_IO.Unbounded_IO ;  use Ada.Text_IO.Unbounded_IO ;with Ada.Strings.Unbounded ;  use Ada.Strings.Unbounded ;

Anh Vo

  reply	other threads:[~2016-01-08 22:08 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-06 15:55 Re-write a file in Ada comicfanzine
2016-01-07 13:02 ` comicfanzine
2016-01-08 20:35 ` comicfanzine
2016-01-09  9:50   ` Brian Drummond
2016-01-08 21:22 ` Randy Brukardt
2016-01-08 22:08   ` Anh Vo [this message]
2016-01-10 16:54 ` comicfanzine
2016-01-10 18:59   ` Björn Lundin
2016-01-11 17:16   ` Brian Drummond
2016-01-18 15:05     ` gautier_niouzes
2016-01-19 12:24       ` Brian Drummond
2016-01-19 16:52         ` gautier_niouzes
2016-01-21 12:26           ` Brian Drummond
2016-01-10 22:57 ` comicfanzine
2016-01-11  1:59   ` Anh Vo
2016-01-11 10:09   ` Björn Lundin
2016-01-18  0:22 ` comicfanzine
2016-01-18  9:50   ` AdaMagica
2016-01-18 17:27     ` Björn Lundin
2016-01-18 11:52   ` Brian Drummond
2016-01-18 17:30   ` Björn Lundin
2016-01-18 17:25 ` comicfanzine
2016-01-18 17:49   ` J-P. Rosen
2016-01-18 18:37   ` Simon Wright
2016-01-19 12:33   ` Brian Drummond
2016-01-19 14:40     ` Simon Wright
2016-01-21 12:31       ` Brian Drummond
2016-01-19 12:04 ` comicfanzine
2016-01-19 14:29   ` Anh Vo
2016-01-19 14:35     ` Simon Wright
2016-01-19 16:54       ` Jeffrey R. Carter
2016-01-19 17:32         ` Anh Vo
2016-01-19 16:53   ` Stephen Davies
2016-01-20  1:12 ` comicfanzine
replies disabled

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