The number of actual arguments, NPAR, can be obtained with:
The type and mode of the K-th argument can be obtained by:
where
IT=0 unknown MODE=0 unknown
1 integer 1 expression
2 real 2 constant
3 character 3 variable
4 logical 4 array element
5 double precision 5 function call
6 Hollerith 6 array name
7 external
8 [sequence of statements]
9 omitted (empty) argument
The value of the Kth argument or the execution of its code is obtained by:
CALL CSCPAR (K)
In fact this subroutine fills the system COMMON block CSWPAR,
whose definition is described below:
DOUBLE PRECISION DVPAR
COMMON/CSWPAR/LORN,IREP,NPAR,ITPAR,MDPAR,JRESP,JCHPAR,NCHPAR,IVPAR,RVPAR,DVPAR,JCHVP,NCHVP
where
To obtain the value of the real type argument the next function may be used:
R=CSRPAR(K)
These two latter functions call subroutine CSCPAR internally.
Examples:
Using an Algol-like manner of argument processing.
FUNCTION SUM(P1,I,N)
SUM=0.
DO I=1,N SUM=SUM+CSRPAR(1) OD
END
The COMIS main program
.....
LORN=1 I=1 S=SUM(A(I),I,N) END produces S=A(1)+A(2)+ ... +A(N)
while the program
.....
LORN=1 K=1 S=SUM(A(I,K)*B(K,J),K,M) END produces the (I,J)th inner product of A and B.
The length of the K-th argument's text can be obtained by
The K-th argument's text can be moved into a variable of character type by
The code of the K-th argument with the mode "sequence of statements" can be stored in the COMIS internal buffer as the COMIS routine with given name NAME by
CALL CSSPAR CSSPAR(K,'NAME',IADP)
where output parameter IADP is the address of the COMIS routine.