From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,4d1e35c40963653d,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-08-11 21:55:01 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed1.cidera.com!Cidera!cyclone1.gnilink.net!spamfinder.gnilink.net!typhoon1.gnilink.net.POSTED!not-for-mail Message-ID: <3B763C53.18B8C606@mail.verizon.net> From: Jack Scheible Reply-To: vze26j9s@verizon.net X-Mailer: Mozilla 4.5 [en]C-CCK-MCD BA45DSL (Win98; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Trying to pass strings to Fortan routines Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Sun, 12 Aug 2001 04:54:59 GMT NNTP-Posting-Host: 138.88.65.217 X-Complaints-To: business-support@verizon.com X-Trace: typhoon1.gnilink.net 997592099 138.88.65.217 (Sun, 12 Aug 2001 00:54:59 EDT) NNTP-Posting-Date: Sun, 12 Aug 2001 00:54:59 EDT Xref: archiver1.google.com comp.lang.ada:11806 Date: 2001-08-12T04:54:59+00:00 List-Id: 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