Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
* FORTRAN arg lists on AXP
@ 1995-03-01 21:51 Jay Olson
  1995-03-03 14:49 ` Steve Lionel
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jay Olson @ 1995-03-01 21:51 UTC (permalink / raw)


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,).

	- Jay Olson
	Triton Software Group Ltd.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: FORTRAN arg lists on AXP
  1995-03-01 21:51 FORTRAN arg lists on AXP Jay Olson
@ 1995-03-03 14:49 ` Steve Lionel
  1995-03-06 20:36 ` shumaker
  1995-03-06 23:57 ` Martin Cohen
  2 siblings, 0 replies; 4+ messages in thread
From: Steve Lionel @ 1995-03-03 14:49 UTC (permalink / raw)



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?

DEC Fortran has the IARGCOUNT intrinsic for this purpose.  Please be aware
that the Fortran language does not provide for omitting arguments when calling
Fortran routines and that this is not really supported.  It works most of
the time, as long as the argument you omit is not CHARACTER or used in an
adjustable array bounds expression.  Be sure to declare VOLATILE any argument
which may be omitted.  For further details, see the DEC Fortran release notes.
-- 

Steve Lionel                      Mail: lionel@quark.enet.dec.com
DEC Fortran Development           WWW:  http://www.digital.com/info/slionel.html
Digital Equipment Corporation     CompuServe: 75263,3001
110 Spit Brook Road, ZKO2-3/N30
Nashua, NH 03062-2698             "Free advice is worth every cent"

For a summary of Digital's Internet services, send mail to info@digital.com


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: FORTRAN arg lists on AXP
  1995-03-01 21:51 FORTRAN arg lists on AXP Jay Olson
  1995-03-03 14:49 ` Steve Lionel
@ 1995-03-06 20:36 ` shumaker
  1995-03-06 23:57 ` Martin Cohen
  2 siblings, 0 replies; 4+ messages in thread
From: shumaker @ 1995-03-06 20:36 UTC (permalink / raw)



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.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: FORTRAN arg lists on AXP
  1995-03-01 21:51 FORTRAN arg lists on AXP Jay Olson
  1995-03-03 14:49 ` Steve Lionel
  1995-03-06 20:36 ` shumaker
@ 1995-03-06 23:57 ` Martin Cohen
  2 siblings, 0 replies; 4+ messages in thread
From: Martin Cohen @ 1995-03-06 23:57 UTC (permalink / raw)


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,).
>
>	- Jay Olson
>	Triton Software Group Ltd.

I am somewhat partial to Fortran myself, but it seems to me that
macro code could be more easily converted to C, since C is,
anomg other things, a high-level assembly language. One of
the things C supports is varying number of arguments (see varargs).
Fortran does not support this.

Good luck - I hope the choice of Fortran was technical, not managerial!
-- 
Marty Cohen (mcohen@nrtc.northrop.com) - Not the guy in Philly
  This is my opinion and is probably not Northrop Grumman's!
          Use this material of your own free will


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1995-03-06 23:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1995-03-01 21:51 FORTRAN arg lists on AXP Jay Olson
1995-03-03 14:49 ` Steve Lionel
1995-03-06 20:36 ` shumaker
1995-03-06 23:57 ` Martin Cohen

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