comp.lang.ada
 help / color / mirror / Atom feed
* comparing characters in string
@ 2014-10-04 23:03 Stribor40
  2014-10-05  1:41 ` Shark8
  0 siblings, 1 reply; 5+ messages in thread
From: Stribor40 @ 2014-10-04 23:03 UTC (permalink / 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


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

end of thread, other threads:[~2014-10-05 12:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-04 23:03 comparing characters in string Stribor40
2014-10-05  1:41 ` Shark8
2014-10-05  7:06   ` Simon Wright
2014-10-05 12:16     ` Shark8
2014-10-05 12:41       ` Simon Wright

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