comp.lang.ada
 help / color / mirror / Atom feed
From: Jack Scheible <vze26j9s@mail.verizon.net>
Subject: Trying to pass strings to Fortan routines
Date: Sun, 12 Aug 2001 04:54:59 GMT
Date: 2001-08-12T04:54:59+00:00	[thread overview]
Message-ID: <3B763C53.18B8C606@mail.verizon.net> (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




             reply	other threads:[~2001-08-12  4:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-12  4:54 Jack Scheible [this message]
2001-08-12  5:24 ` Trying to pass strings to Fortan routines 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
replies disabled

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