comp.lang.ada
 help / color / mirror / Atom feed
* JGNAT: java strings converted to Ada have 'first = 0
@ 2001-01-03  3:23 Terry Westley
  0 siblings, 0 replies; only message in thread
From: Terry Westley @ 2001-01-03  3:23 UTC (permalink / raw)


In using JGNAT, I find that when I convert Java.Lang.String.Ref to an
Ada string, it's 'first is 0!

This really causes havoc (constraint_error) in some situations.  I don't
see anything in the JGNAT user guide about this.

Perhaps I'm converting them incorrectly...

   procedure To_String (JStr : in Java.Lang.String.Ref) return String is
      use Java.Lang.String;
      JStr_Access : Java.Lang.String.String_Access;
   begin -- To_String
      if JStr = null then
         return "";
      end if;
      JStr_Access := +JStr;
      return JStr_Access.all;
   end To_String;

--
Terry Westley
twestley@acm.org
Learn about TASH, an Ada binding to Tcl/Tk at http://www.adatcl.com






^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-01-03  3:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-01-03  3:23 JGNAT: java strings converted to Ada have 'first = 0 Terry Westley

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