C C $Id: namemcf.F,v 1.3 1998/07/16 16:40:07 jjv5 Exp arjan $ C C------------------------------------------------------------------------ function namemcf(basenm, inti, ext) C returns basename.ext C e.g. namemcf('divcon',33,'in') = divcon33.in integer inti character namemcf*20, basenm*20, ext*20 C locals: integer i, zero, copy, rem, lens, tmp, begi, lbasenm, lext integer max parameter (max=20) character s*20, str*20, c namemcf = ' ' C find the strlen of basenm and ext do 5 i=1,20 c = basenm(i:i) if (((c .lt. 'A') .or. (c .gt. 'Z')) & .and. & ((c .lt. 'a') .or. (c .gt. 'z'))) then lbasenm = i - 1 goto 6 endif 5 continue 6 do 7 i=1,20 c = ext(i:i) if (((c .lt. 'A') .or. (c .gt. 'Z')) & .and. & ((c .lt. 'a') .or. (c .gt. 'z'))) & then lext = i - 1 goto 8 endif 7 continue 8 if ((lext .le. 0) .or. (lbasenm .le. 0)) return s = ' ' str = ' ' zero = ichar('0') copy = abs(inti) lens = max do 10 i=1,max,1 rem = mod(copy,10) s(i:i) = char(rem + zero) copy = copy / 10 if (copy .eq. 0) then lens = i goto 15 endif 10 continue 15 continue str(1:lbasenm) = basenm(1:lbasenm) begi = lbasenm + 1 if (inti .lt. 0) then str(begi:begi) = '-' begi = begi + 1 endif do 20 i=0,lens-1,1 tmp = lens-i str(i+begi:i+begi) = s(tmp:tmp) 20 continue str(lens+begi:lens+begi) = '.' do 30 i=1,lext str(lens+begi+i:lens+begi+i) = ext(i:i) 30 continue namemcf = str return end