SUBROUTINE GETWTS C C GETWTS.SUB NAB 21-Mar-85/28-Mar-85. C C Description: C C Prompt for and accept the filter weight values for the convo- C lution mask. Then convert the weights from character strings C to integer values. C #include "CNVL2D.DAT" C 1 FORMAT ('+Enter the ',I1,'x',I1,' convolution mask filter', * ' weights',/) 2 FORMAT ('+Enter ',I1,' weights for row ',I1,/) 3 FORMAT (/,' ?CNVL2D-E-No weights entered, try again',A1) 4 FORMAT (/,' ?CNVL2D-E-Too few weights entered, try again',A1) 5 FORMAT (I4) 6 FORMAT (/,' ?CNVL2D-E-Weight value error, try again',A1) C C TYPE 1,MSKSIZ,MSKSIZ DO 370 IROW = 1,MSKSIZ 300 CONTINUE TYPE 2,MSKSIZ,IROW CALL GTLIN (STRING) ILEN = LEN (STRING) IF (ILEN .NE. 0) GO TO 310 TYPE 3,BEEP(1) GO TO 300 310 CONTINUE ICOL = 0 ISTRT = 1 320 CONTINUE ICOL = ICOL + 1 IPOS = INDEX (STRING,COMMA,ISTRT) IF (IPOS .NE. 0) GO TO 340 IF (ICOL .EQ. MSKSIZ) GO TO 330 TYPE 4,BEEP(1) GO TO 300 330 CONTINUE IPOS = LEN (STRING) + 1 340 CONTINUE IEND = IPOS - 1 ILEN = IPOS - ISTRT CALL SUBSTR (STRING,SBSTR,ISTRT,IEND) DECODE (ILEN,5,SBSTR,ERR=350) FWTS(ICOL,IROW) IF (FWTS(ICOL,IROW) .GT. 127) GO TO 350 IF (FWTS(ICOL,IROW) .LT. -128) GO TO 350 IF (ICOL .EQ. MSKSIZ) GO TO 360 ISTRT = IPOS + 1 GO TO 320 350 CONTINUE TYPE 6,BEEP(1) GO TO 300 360 CONTINUE 370 CONTINUE C RETURN END