comp.lang.ada
 help / color / mirror / Atom feed
* Newbie question: Binary operator expected?
@ 2011-05-13 16:05 Geoffrey Laval
  2011-05-13 17:14 ` Adam Beneschan
  2011-05-13 17:50 ` Ludovic Brenta
  0 siblings, 2 replies; 4+ messages in thread
From: Geoffrey Laval @ 2011-05-13 16:05 UTC (permalink / raw)


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.



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-05-14 10:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-13 16:05 Newbie question: Binary operator expected? Geoffrey Laval
2011-05-13 17:14 ` Adam Beneschan
2011-05-13 17:50 ` Ludovic Brenta
2011-05-14 10:40   ` Geoffrey Laval

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox