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,ec714b0cc0d830ab,start X-Google-Attributes: gid103376,public From: Konstantin Gromov Subject: Beginners Ada Question on Ada IO. Date: 1996/12/11 Message-ID: <32AE796C.36DDA3C0@leland.stanford.edu>#1/1 X-Deja-AN: 203469571 cc: gkg@leland.stanford.edu content-type: text/plain; charset=us-ascii organization: Stanford GPS Laboratory mime-version: 1.0 newsgroups: comp.lang.ada x-mailer: Mozilla 3.01 (X11; I; Linux 2.0.6 i586) Date: 1996-12-11T00:00:00+00:00 List-Id: Hello everyone, I just started learning Ada, and I like it better than C or C++. But one thing drive me nuts... All text books and tutorials talk only about character IO, and in what I am doing I need binary IO. I am trying to generate some data and then output it to the file byte by byte. (Later I'll have to read binary data from one file (really device) and send it to another.) All this happens under Unix. Here example of what I am trying to do: .... type EEPROM is array(0 .. 16383 , 0 .. 6) of Integer range 0 .. 255; .... Data : EEPROM; ROM_File : Ada.Text_IO.File_Type; .... -- Here I am stuffing array "Data" with some numbers .... Ada.Text_IO.Create(ROM_File, Ada.Text_IO.Out_File, "rom.dat"); for A in 0 .. 16383 loop -- Next line is a line wich causes me problems. -- Basicly I am trying to do C thing: "putc(Data(A,6), ROM_File);" -- but it is wrong, and I cannot find an answer... Ada.Text_IO.Put ( Item => (Character)Data(A,6), File => ROM_File ); Ada.Text_IO.New_Line(File => ROM_File); end loop; Ada.Text_IO.Close(ROM_File); I'll appreciate any help or hints on where I can find a detailed information on the subject. Please answer via email. Thank you in advance for your help. Konstantin Gromov gkg@leland.stanford.edu