comp.lang.ada
 help / color / mirror / Atom feed
From: Stribor40 <ikamzic@gmail.com>
Subject: comparing characters in string
Date: Sat, 4 Oct 2014 16:03:27 -0700 (PDT)
Date: 2014-10-04T16:03:27-07:00	[thread overview]
Message-ID: <af79bb16-617e-46b6-b0b6-dae39a2089f8@googlegroups.com> (raw)

I am trying to do something with this function...For example I would pass 2 strings to function like this....

     function tt (a : in String ; b : in String) return Boolean is
         begin
              for i in a'Range loop
                  if a'(a'First) = b(b'First + 1) then
                     return false;
                  end if;
              end loop;
                     return true;
     end tt;
          
I am calling it like so...

b: Boolean := tt("123","321");

What the function is suppose to do is take first character from first parametar and compare it to every character in string b but not first character of string b.

Unfortunately my compiler doesnt like me and gives me this error...

subtype mark required in this context
found "a" declared at line 6
compilation error


             reply	other threads:[~2014-10-04 23:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-04 23:03 Stribor40 [this message]
2014-10-05  1:41 ` comparing characters in string Shark8
2014-10-05  7:06   ` Simon Wright
2014-10-05 12:16     ` Shark8
2014-10-05 12:41       ` Simon Wright
replies disabled

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