comp.lang.ada
 help / color / mirror / Atom feed
* Trying to pass strings to Fortan routines
@ 2001-08-12  4:54 Jack Scheible
  2001-08-12  5:24 ` tmoran
  2001-08-12 11:17 ` Dan Nagle
  0 siblings, 2 replies; 7+ messages in thread
From: Jack Scheible @ 2001-08-12  4:54 UTC (permalink / raw)


One of the promises of Ada was that one could use old libraries with the
Interfaces packages.  It's not going so well.  I have some old FORTRAN
libraries, and some of the routine accept CHARACTER*(*) arguments.  When
FORTRAN makes a subprogram call with one or more "string" arguments, it
passes the lengths of those strings as arguments _after_ all the
declared arguments.  I can get this to work with C.  So if I call

      SUBROUTINE SUB( S1, S2 )
      CHARACTER*(*) S1, S2

with the C statement

      sub_( s1, s2, strlen(s1), strlen(s2) );

All is well.  If I try the same thing in Ada (gnat), I get a Constraint
Error exception.

Actually, I get a Constraint Error if I just pass a String and anything
else.

Any ideas?

Thanks.

-jack




^ permalink raw reply	[flat|nested] 7+ messages in thread
[parent not found: <3B765238.6F013AD3@mail.verizon.net>]

end of thread, other threads:[~2001-08-13 18:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-12  4:54 Trying to pass strings to Fortan routines Jack Scheible
2001-08-12  5:24 ` tmoran
2001-08-12 11:17 ` Dan Nagle
     [not found] <3B765238.6F013AD3@mail.verizon.net>
2001-08-12  7:14 ` tmoran
2001-08-12 15:28   ` Jack Scheible
2001-08-12 18:17     ` tmoran
2001-08-13 18:28       ` Jack Scheible

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