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.8 required=5.0 tests=BAYES_00,INVALID_MSGID, MSGID_RANDY,SUBJ_ALL_CAPS autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c968fe4b2cbebf4,start X-Google-Attributes: gid103376,public From: ashraf2000@x-stream.co.uk Subject: HELP WITH SIMPLE PROGRAM PLEASE Date: 2000/04/17 Message-ID: <8df1sn$hh4$1@nnrp1.deja.com>#1/1 X-Deja-AN: 612206907 X-Http-Proxy: 1.0 wwwcache.dcs.gla.ac.uk:8080 (Squid/2.2.STABLE5), 1.0 x36.deja.com:80 (Squid/1.1.22) for client 130.209.248.118, 130.209.240.138 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Mon Apr 17 13:00:13 2000 GMT X-MyDeja-Info: XMYDJUIDashraf3000 Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt) Date: 2000-04-17T00:00:00+00:00 List-Id: HI, I am a beginner and trying to sort numbers which are read from a file in random order and needs to be sorted out in numerical order. e.g 7,10,1,5,.... into 1,2,3,.... Below is some code to read the number from a file and display them. Please help me sort them out. THANKS in advance. ashraf2000@x-stream.co.uk ---------------------------------- NOTE: i'm using ADAGIDE. The program doesn't takes input from user. Uses a text file to read data. (run-runoptions-redirectinput ... to be specific) ---------------------------------- with Ada.Text_IO; use Ada.Text_IO; with Ada.Integer_Text_IO; use Ada.Integer_Text_IO; with Ada.Float_Text_IO; use Ada.Float_Text_IO; with Ada.Numerics.Elementary_Functions; use Ada.Numerics.Elementary_Functions; procedure digits_sort is type no_type is array (1..10) of integer; no:no_type; procedure read is begin for x in no'first..no'last loop get(no(x)); new_line; put(no(x),2); end loop; end read; procedure check is temp:integer; begin if no(1)>no(2) then temp:=no(1); no(1):=no(2); no(2):=temp; end if; end check; procedure output is begin new_line(3); for i in 1..10 loop put(no(i),2); new_line; end loop; end output; begin read; check; output; end digits_sort; Sent via Deja.com http://www.deja.com/ Before you buy.