comp.lang.ada
 help / color / mirror / Atom feed
From: Marin David Condic <condicma@bogon.pwfl.com>
Subject: Re: Sequential_IO
Date: 1999/08/19
Date: 1999-08-19T00:00:00+00:00	[thread overview]
Message-ID: <37BC1D14.659D23CF@pwfl.com> (raw)
In-Reply-To: 11f733ec.81e1abff@usw-ex0102-014.remarq.com

Shawn Barber wrote:

> -----------------------------------------------------------
>       -- Get the parameters entered on the command line.
>    Get_Command_Line_Parameters
>       ( NVM_File_Name    => NVM_Input_File_Name  ,
>         NVM_Name_Length  => Length_Of_NVM_Name   ,
>         Memory_Address   => Memory_Start_Address ,
>         DBG_File_Name    => DBG_Output_File_Name ,
>         DBG_Name_Length  => Length_Of_DBG_Name   ) ;
>
>       -- Open the output file.
>    text_io.create
>       ( File => Output_File           ,
>         Mode => text_io.out_file      ,
>         Name => DBG_Output_File_Name  ) ;

Just a quick shot in the dark, because it looked wrong & may be the simple
explanation:

Try: Name => DBG_Output_File_Name (1..Length_Of_DBG_Name) ) ;

You are otherwise referencing the whole string and it may have trailing garbage
in it. AFAIK, GNAT 3.11p has no problem opening up a file in the current
directory when you execute it from the command line. (As observed elsewhere,
there *may* be problems if you are running it from an IDE such as AdaGIDE, but
I've never encountered any.)

Another helpful debugging tip: Put some "Put_Line" statements in where you read
the command line parameters and just before you open the file to be sure you are
getting what you think you are getting into the strings.  And be *real careful*
that you reference just the slice of the string which is valid, because it is a
very common error to reference the whole string - which may or may not be valid.

I like to avoid this sort of thing by getting everything into an
Unbounded_String ASAP and converting back as needed. (id est: use
To_Unbounded_String (Str (1..Last)) right away and then use To_String (UStr) to
convert back when needed as a parameter to something else.)

Hope this helps. I'll give it a more careful look later if this doesn't fix it.

MDC
--
Marin David Condic
Real Time & Embedded Systems, Propulsion Systems Analysis
United Technologies, Pratt & Whitney, Large Military Engines
M/S 731-95, P.O.B. 109600, West Palm Beach, FL, 33410-9600
***To reply, remove "bogon" from the domain name.***

Visit my web page at: http://www.mcondic.com/






      parent reply	other threads:[~1999-08-19  0:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-08-18  0:00 Sequential_IO Shawn Barber
1999-08-18  0:00 ` Sequential_IO Larry Kilgallen
1999-08-18  0:00 ` Sequential_IO Marin David Condic
1999-08-18  0:00 ` Sequential_IO Ted Dennison
1999-08-19  0:00 ` Sequential_IO Tucker Taft
1999-08-19  0:00   ` Sequential_IO Marin David Condic
1999-08-19  0:00   ` Sequential_IO Ted Dennison
1999-08-19  0:00     ` Sequential_IO Robert Dewar
1999-08-21  0:00     ` Sequential_IO Simon Wright
1999-08-19  0:00 ` Sequential_IO Shawn Barber
1999-08-19  0:00   ` Sequential_IO David C. Hoos, Sr.
1999-08-19  0:00   ` Sequential_IO Ted Dennison
1999-08-19  0:00   ` Marin David Condic [this message]
replies disabled

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