From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,aeb3845dd355cf6c X-Google-Attributes: gid103376,public From: Shawn Barber Subject: Re: Sequential_IO Date: 1999/08/19 Message-ID: <11f733ec.81e1abff@usw-ex0102-014.remarq.com>#1/1 X-Deja-AN: 514622964 References: <0a0133f8.48529b21@usw-ex0102-014.remarq.com> X-Originating-Host: 140.76.238.7 X-Complaints-To: wrenabuse@remarq.com X-Trace: WReNphoon3 935057068 10.0.2.14 (Thu, 19 Aug 1999 03:04:28 PDT) Organization: http://www.remarq.com: The World's Usenet/Discussions Start Here NNTP-Posting-Date: Thu, 19 Aug 1999 03:04:28 PDT Newsgroups: comp.lang.ada X-Wren-Trace: eDkcNDUsayFqSi8wLns9Igs5Jzkoc3cqKHVnbmBjdy94bSpgeS4= Date: 1999-08-19T00:00:00+00:00 List-Id: Ok, I forgot this last time. I'm working on NT4 with the GNAT3.11p compiler. Here are the peices of code which apply to this problem: procedure Get_Command_Line_Parameters ( ------------------------------------------------------------ --- -- The purpose of this procedure is to get the command -- -- line parameters. -- ------------------------------------------------------------ --- NVM_File_Name : out string ; NVM_Name_Length : out natural ; Memory_Address : out string ; DBG_File_Name : out string ; DBG_Name_Length : out natural ) is -- Command Line Argument Number of the NVM file name. NVM_Argument : constant natural := 1 ; -- Command Line Argument Number of the Memory Address argument. Memory_Address_Argument : constant natural := 2 ; -- Command line Argument Number of the DBG file name. DBG_Argument : constant natural := 3 ; -- Holds the number of command line arguments which -- were suplied at run-time. Number_Of_Arguments : natural ; begin -- Get the total number of Command Line Arguments supplied. Number_Of_Arguments := command_line.argument_count ; -- If there are not exactly 2 Arguments then the argument list is -- invalid. if Number_Of_Arguments < 2 or Number_Of_Arguments > 3 then -- Incorrect number of arguments enters at the command prompt. raise Invalid_Arguments ; end if ; -- Calculate the length of NVM_File_Name. NVM_Name_Length := command_line.argument ( NVM_Argument )'last ; -- Get the File Name from the Argument list. Fixed.Move ( Source => command_line.argument ( NVM_Argument ) , Target => NVM_File_Name ) ; -- Get the starting memory address from the argument list. Fixed.Move ( Source => command_line.argument ( Memory_Address_Argument ) , Target => Memory_Address ) ; if Number_Of_Arguments = 3 then -- Calculate the length of DBG_File_Name. DBG_Name_Length := command_line.argument ( DBG_Argument )'last ; -- Get the File Name from the Argument list. Fixed.Move ( Source => command_line.argument ( DBG_Argument ) , Target => DBG_File_Name ) ; else -- Set the DBG File name length to the default. DBG_Name_Length := 11 ; -- Set the DBG File name to the default. Fixed.Move ( Source => "DEFAULT.DBG" , Target => DBG_File_Name ) ; end if; end Get_Command_Line_Parameters ; ----------------------------------------------------------- -- 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 ) ; -- Redirect output. text_io.set_output ( File => Output_File ) ; -- Open the source file. One_Word_IO.Open ( File => Input_File , Mode => One_Word_IO.In_File , Name => NVM_Input_File_Name ) ; ----------------------------------------------------------- The first piece of code get the command line parameters. The second has the call to the get parameters procedure then the create, redirection and open. One_Word_IO is an instansiation of Sequential_IO. I've checked the filename after being passed back from the get parameters procedure. I hope this helps clear something up. Thanks. Shawn * Sent from RemarQ http://www.remarq.com The Internet's Discussion Network * The fastest and easiest way to search and participate in Usenet - Free!