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, MSGID_RANDY,T_FILL_THIS_FORM_SHORT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b2f0d9dd618dc28c,start X-Google-Attributes: gid103376,public From: irons@my-deja.com Subject: how to make a record work??? any help would be greatly appreciated Date: 1999/09/14 Message-ID: <7rm3n8$to1$1@nnrp1.deja.com>#1/1 X-Deja-AN: 525005932 X-Http-Proxy: 1.1 x23.deja.com:80 (Squid/1.1.22) for client 209.136.3.50 Organization: Deja.com - Share what you know. Learn what you don't. X-Article-Creation-Date: Tue Sep 14 18:21:37 1999 GMT X-MyDeja-Info: XMYDJUIDirons Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 4.01; Windows 98) Date: 1999-09-14T00:00:00+00:00 List-Id: Hi i'm getting a lot of errors and have a hard time in general trying to make this simple program to work ..here's the code: (the questions are written after the code) with ada.text_io,ada.integer_text_io; use ada.text_io,ada.integer_text_io; procedure countries is country_number:integer:=6; type a is array (1..6) of integer; type country is (syria,iran,turkey,egypt,jordan,saudi_arabia); type neighbouring_country is record country_name:string(1..2); syria_neighbour:string(1..1); iran_neighbor:string(1..1); turkey_neighbour:string(1..1); egypt_neighbour:string(1..1); jordan_neighbour:string(1..1); saudi_arabia_neighbour:string(1..1); end record; type my_country is array (1..6) of neighbouring_country; a(i):=my_country(i); begin for i in 1..6 loop get (my_country(i).neighbouring_country); put (my_country(i).country_name); get (my_country(i).syria_neighbour); put (my_country(i).syria_neighbour); get (my_country(i).iran_neighbor); put (my_country(i).iran_neighbor); get (my_country(i).turkey_neighbour); put (my_country(i).turkey_neighbour); get (my_country(i).egypt_neighbour); put (my_country(i).egypt_neighbour); get (my_country(i).jordan_neighbour); put (my_country(i).jordan_neighbour); get (my_country(i).saudi_arabia_neighbour); put (my_country(i).saudi_arabia_neighbour); new_line; end loop; end countries; the line "a(i):=my_country(i);" and everything inside the loop is not working ...i'm trying to make a program that allows the user to input the country prefix and if that country touchs other countries... for example i'm trying to make the table look like this: (this table just lists the country and if it touchs a neighbouring country) ----------------------------------------------------- contries|syria|iran|turkey|egypt|jordan|saudi_arabia| ----------------------------------------------------- syria | -- | no | yes | no | yes | no | ----------------------------------------------------- iran | no | -- | yes | no | no | no | ----------------------------------------------------- turkey | yes | yes| -- | no | no | no | ----------------------------------------------------- egypt | no | no | no | -- | yes | no | ----------------------------------------------------- jordan | yes | no | no | yes | -- | yes | ----------------------------------------------------- saudi_ar| no | no | no | no | yes | -- | ----------------------------------------------------- input would be: sy,--,no, yes,no yes,no (this is for syria) then i would do the same all the way down to saudi_arabia . for example: saudi_arabia's input would be it's prefix and it's if it touchs another country or not input: sa,no,no,no,yes,-- i know this looks like a lot ...any suggestions on how to make this program work would be of great value to me and would be greatly appreciated my e-mail: okdeh@zebra.net Sent via Deja.com http://www.deja.com/ Share what you know. Learn what you don't.