From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,2952d0a9df61022d X-Google-Attributes: gid1164f8,public X-Google-ArrivalTime: 1995-03-06 14:45:56 PST Path: bga.com!news.sprintlink.net!howland.reston.ans.net!gatech!news-feed-1.peachnet.edu!paperboy.wellfleet.com!noc.near.net!eisner!shumaker From: shumaker@eisner.decus.org Newsgroups: comp.sys.dec Subject: Re: FORTRAN arg lists on AXP Message-ID: <1995Mar6.153618.9303@eisner> Date: 6 Mar 95 15:36:17 -0500 References: <3j2q8v$5hc@arc.electriciti.com> Organization: DECUServe In article <3j2q8v$5hc@arc.electriciti.com>, jjo@triton.com (Jay Olson) writes: > I am converting some VAX MACRO code to FORTRAN as part of an AXP conversion > effort. Some of the entry points in this code are supposed to accept variable length > argument lists. Is there any way in DEC FORTRAN for OpenVMS/AXP (or any other > language) to determine the number of arguments a subroutine has been passed? > > Note that this is the case where the number of commas may vary (e.g CALL XXX(A1,A2) > and CALL XXX(A1) are both supposed to be allowed). I can use %LOC to determine if an > argument has been left out, as in CALL XXX(A1,). There's a couple of intrinsic functions that will be a lot of help. In 6.1 of DEC Fortran was introduced: II = IARGCOUNT () which retuns just what it says. Introduced with 6.2 of DEC Fortran was: PTR = IARGPTR () which returns an INTEGER*8 address of the argument block as defined by the calling standard. More details about each in the Release Notes for Versions 6.1 and 6.2 of DEC Fortran.