53 subroutine w3as00(nch_parm,cparm,iret_parm)
58 parameter(maxnbyt=112)
63 parameter(maxnwrds=maxnbyt/kbytpwrd)
77 integer jwork(maxnwrds)
79 equivalence(jwork,cwork)
81 integer(4) nargsinline,iargc,iar
102 lmt_dest = len(cparm)
104 103
format(1h ,
'W3AS00: dimensioned size (in bytes) of dest strng=',
106 if(lmt_dest .le. 0)
then
108 105
format(1h ,
'W3AS00:FAILED on undefined destination ',
109 1
'character string: CPARM')
113 else if (lmt_dest .gt. 101)
then
116 lmt_txt = lmt_dest - 1
118 cparm(1:lmt_dest) =
' '
122 nargsinline = iargc()
124 write(6,115) nargsinline
125 115
format(1h ,
'W3AS00: count of args found in command line =', i3)
127 if(nargsinline .gt. 0)
then
130 do iar = 1,nargsinline
135 call getarg(iar,cwork)
137 narg_got = narg_got + 1
138 nchars = lastch(cwork)
140 if(nchars .le. 0)
then
142 125
format(1h ,
'W3AS00:getarg() returned an empty arg for',
147 if((cwork(1:5) .EQ.
'PARM=') .OR.
148 1 (cwork(1:5) .EQ.
'parm=') )
then
152 nchars = notrail(cwork)
162 if(ioutc .LT. lmt_txt)
then
163 lonech = cwork(inc:inc)
164 if((lonech .EQ.
'\\') .OR.
165 1 (lonech .EQ. klf))
then
168 cparm(ioutc:ioutc) = lonech
182 cparm(np1:np1) = nullchr
187 non_parm = non_parm + 1
207 integer function lastch(str)
228 do while(i .LT. limit .AND. str(i+1:i+1) .NE. nullchr
229 1 .AND. str(i+1:i+1) .NE. blank)
236 integer function notrail(str)
259 parameter(blank =
' ')
270 if(limit .le. 0)
go to 999
272 limitnl = index(str(1:limit),nullchr)
273 if(limitnl .le. 0)
then
278 else if(limitnl .eq. 1)
then
287 if(limit .le. 0)
go to 999
292 do while((i .GT. 0) .AND. (str(i:i) .EQ. blank))
subroutine w3as00(nch_parm, cparm, iret_parm)
To get the one command-line argument which starts with "parm="; returning the parm field (without the...