45 read (
lucmd,1001,iostat=ioerr) line
74 subroutine gettkn(line,token,lth)
81 character line*80,token*30,chr*1
83 integer i,j,ichr,ichar
87 logical issepr,is1tok,isctrl,istab
88 isctrl(chr) = ichar(chr).lt.32
89 istab(chr) = ichar(chr).eq.9
90 issepr(chr) = chr.eq.
' '.or. ichar(chr).eq.9 .or. chr.eq.
','
92 is1tok(chr) = chr.eq.
'('.or.chr.eq.
')'.or.chr.eq.
'*'
106 if (isctrl(chr).and. .not.istab(chr))
then
111 if (issepr(chr).and. i.lt.linlth)
goto 2
114 if (i.ge.linlth)
then
123 if (is1tok(chr))
then
142 if (isctrl(chr).and. .not.istab(chr))
then
147 if ( issepr(chr) .or. is1tok(chr) )
then
164 subroutine ungett(token,lth,line)
166 character line*80,tmplin*80,token*30
168 if (lth.gt.0.and.lth.lt.80)
then
170 line=token(:lth) // tmplin
181 function ftoken( token,lth,val )
183 character token*30,tkn*30,tmptkn*30,chr*1
184 integer i,lth,idot,ibrk
191 logical isdot,isexp,isdig
192 isdot(chr)=chr.eq.
'.'
193 isexp(chr)=(chr .eq.
'd' .or. chr .eq.
'D') .or.
194 1 (chr .eq.
'e' .or. chr .eq.
'E')
195 isdig(chr)=chr.ge.
'0' .and. chr.le.
'9'
215 else if (isexp(chr))
then
217 else if (.not. isdig(chr).and.chr.ne.
'-')
then
223 if (ibrk .eq. 0)
then
227 tkn=tkn(:ibrk-1) //
'.' // tmptkn
232 read(tkn,1000,err=13) val
239 1000
format(bn,f20.10)
247 function itoken( token,lth,ival )
264 double precision fval
267 itoken=ftoken(token,lth,fval)
287 character line*80,token*30
297 call gettkn(line,token,lth)
302 if (token.eq.
'(')
then
303 call gettkn(line,token,lth)
311 if (token.eq.
')')
then
320 if (itoken(token,lth,ival))
then
325 write(
luttyo,1000) token(:lth)
329 call gettkn(line,token,lth)
335 if (token.eq.
')')
call gettkn(line,token,lth)
347 call ungett(token,lth,line)
350 1000
format(
'*** Illegal index: ''',a,
''' ***')
integer function indtkn(line)
subroutine gettkn(line, token, lth)
Written for free-form input of parameters for slow-motional calculations. Returns a token consisting ...
logical function ftoken(token, lth, val)
subroutine ungett(token, lth, line)
logical function getlin(line)
issue a prompt and retreive a line from command stream
integer, parameter luttyo
integer, parameter luttyi
logical function itoken(token, lth, ival)
void FORTRAN() lprmpt(void)