c itoc - convert integer int to char string in str integer function itoc(int,str,size) integer iabs,mod integer d,i,int,intval,j,k,size byte str(size),digits(10) data digits/'0','1','2','3','4','5','6','7','8','9'/ intval=iabs(int) str(1)=0 i=1 c repeat 23000 continue c generate digits i=i+1 d=mod(intval,10) str(i)=digits(d+1) intval=intval/10 23001 if(.not.(intval.eq.0.or.i.ge.size))goto 23000 if(.not.(int.lt.0.and.i.lt.size))goto 23003 c then sign i=i+1 str(i)='-' 23003 continue itoc=i-1 c for j=1 23005 if(.not.(j.lt.i))goto 23007 c then reverse k=str(i) str(i)=str(j) str(j)=k i=i-1 j=j+1 goto 23005 c endfor 23007 continue return end