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.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,XPRIO autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,697fa9e83df511c1,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-05-22 08:10:06 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.ems.psu.edu!news.cis.ohio-state.edu!news.maxwell.syr.edu!sunqbc.risq.qc.ca!newsfeed.mathworks.com!btnet-peer0!btnet-feed5!btnet!news.btopenworld.com!not-for-mail From: "Matt Thomas" Newsgroups: comp.lang.ada Subject: Help setting up an array of records Date: Wed, 22 May 2002 15:09:44 +0000 (UTC) Organization: BT Openworld Message-ID: NNTP-Posting-Host: host213-122-142-79.in-addr.btopenworld.com X-Trace: paris.btinternet.com 1022080184 29646 213.122.142.79 (22 May 2002 15:09:44 GMT) X-Complaints-To: news-complaints@lists.btinternet.com NNTP-Posting-Date: Wed, 22 May 2002 15:09:44 +0000 (UTC) X-Newsreader: Microsoft Outlook Express 5.00.2314.1300 X-MSMail-Priority: Normal X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Xref: archiver1.google.com comp.lang.ada:24526 Date: 2002-05-22T15:09:44+00:00 List-Id: I know this might be a stupid question to most of you but i have just started using Ada. For my uni coursework i have to write a program to simulate a vending machine. I'm using an array of records to represent the items in the vending machine but I dont know how to actually get the information into my array. I need to specify the name of the item, its cost and the quantity left. Here is the record and array declaration, any help would be grateful. MACHINE_SLOTS : constant := 6; -- type PRODUCT_TYPE is record NAME : STRING (1..12); LEN : POSITIVE; PRICE : INTEGER; QUANTITY : INTEGER; end record; type PRODUCT_TYPE_ARR is array (1..MACHINE_SLOTS) of PRODUCT_TYPE; PRODUCT : PRODUCT_TYPE_ARR;