c ctoi - convert string at in(i) to integer, increment i integer function ctoi(in,i) byte in(1),digits(10) integer d,i,num data digits/'0','1','2','3','4','5','6','7','8','9'/ c while 23000 if(.not.(in(i).eq.' '.or.in(i).eq.9))goto 23001 c skip over white space i=i+1 goto 23000 c endwhile 23001 continue if(.not.(in(i).eq.'-'))goto 23002 c allow for negative numbers i=i+1 isgn=-1 goto 23003 c else 23002 continue isgn=1 23003 continue c for num=0 23004 if(.not.(in(i).ne.0))goto 23006 d=0 c for j=1 23007 if(.not.(j.le.10))goto 23009 if(.not.(in(i).eq.digits(j)))goto 23010 d=j 23010 continue j=j+1 goto 23007 c endfor 23009 continue if(.not.(d.le.0))goto 23012 c non-digit goto 23006 23012 continue num=10*num+(d-1) i=i+1 goto 23004 c endfor 23006 continue ctoi=isgn*num return end