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,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 = command_argument_count()
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 get_command_argument(iar,cwork)
137 narg_got = narg_got + 1
138 nchars = lastch(cwork)
140 if(nchars .le. 0)
then
142 125
format(1h ,
'W3AS00:get_command_argument()',
143 a
'returned an empty arg for',
148 if((cwork(1:5) .EQ.
'PARM=') .OR.
149 1 (cwork(1:5) .EQ.
'parm=') )
then
153 nchars = notrail(cwork)
163 if(ioutc .LT. lmt_txt)
then
164 lonech = cwork(inc:inc)
165 if((lonech .EQ.
'\\') .OR.
166 1 (lonech .EQ. klf))
then
169 cparm(ioutc:ioutc) = lonech
183 cparm(np1:np1) = nullchr
188 non_parm = non_parm + 1
208 integer function lastch(str)
229 do while(i .LT. limit .AND. str(i+1:i+1) .NE. nullchr
230 1 .AND. str(i+1:i+1) .NE. blank)
237 integer function notrail(str)
260 parameter(blank =
' ')
271 if(limit .le. 0)
go to 999
273 limitnl = index(str(1:limit),nullchr)
274 if(limitnl .le. 0)
then
279 else if(limitnl .eq. 1)
then
288 if(limit .le. 0)
go to 999
293 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...