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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,98adf46b4f219ef7,start X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!f15g2000pro.googlegroups.com!not-for-mail From: Geoffrey Laval Newsgroups: comp.lang.ada Subject: Newbie question: Binary operator expected? Date: Fri, 13 May 2011 09:05:53 -0700 (PDT) Organization: http://groups.google.com Message-ID: <7aed288d-b5eb-428d-8a6a-0e7739e80c78@f15g2000pro.googlegroups.com> NNTP-Posting-Host: 195.132.190.185 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1305302754 16797 127.0.0.1 (13 May 2011 16:05:54 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 13 May 2011 16:05:54 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: f15g2000pro.googlegroups.com; posting-host=195.132.190.185; posting-account=VaYoVAoAAAD7e0p6XEn-wjIn8y5eEGIz User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.18) Gecko/20100427 Galeon/2.0.7 (Debian 2.0.7-2.1+b1),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:20221 Date: 2011-05-13T09:05:53-07:00 List-Id: Hi everybody, I'm fairly new to Ada and I've tried different ways, even switching from Bounded_Strings to standard strings, I don't know what I do wrong! eightball.adb:8:60: binary operator expected Here is my source code: 5 procedure eightball is 6 rep : integer range 1 .. 3; 7 touche : character; 8 package BS_Length is new Generic_Bounded_Length(300'Length); 9 use BS_Length; 10 question : bounded_string; 11 question : To_Bounded_String; 12 subtype reponse is integer range 1 .. 3; 13 package reponseAlea is new Ada.Numerics.Discrete_Random(reponse); 14 use reponseAlea; 15 G : Generator; 16 begin I've changed it several times, and the error is still around the length attribute. I think in the course of changing it, I even worsened the wrongness of the code. I'm also confused as I've stumbled upon different websites and everybody seems to have its own manner to use strings. Some use these like I did and others do Sname : bounded_string := "something"; so what is the right way? I've tried to find out where I was wrong by searching about binary operators, but it didn't worked out, so I thought I'd progress easier on this if I asked here even if most questions asked are one level or a thousand higher than mine. Also, the compiler I'm using is Gnat. (Gnat is the compiler, right, and GPS the IDE?) Thanks in advance, Geoffrey Laval.