identificationdivision. program-id. substitute. * aus Wirth, systematisches Programmieren p. 110 author. "JD". date-written. 11.9.2005. date-compiled. datadivision. working-storagesection.
78 bd pic 9(4) value 100.
77 i pic 9(4).
77 j pic 9(4).
77 k pic 9(4).
77 m pic 9(4).
77 n pic 9(4).
77 d pic 9(4).
77 P pic 9(4).
77 q.
88 true-v value 1.
88 false-v value 0. linkagesection.
77 x pic 9(4)V9(4) occurs bd.
77 z pic 9(4)V9(4) occurs bd.
77 r pic 9(4).
77 temp1 pic 9(4). proceduredivisionusing z r. * substitutes x in row z move i to p performuntil q or (i=p) move 1 to j performuntilnot q or (j>k) compute temp1 = i + j - 1 if x(j) = z(temp1) thenset true-v totrue elseset false-v totrueend-if add 1 to j end-perform add 1 to i if i > n thenmove 1 to i end-if end-perform if q then subtract k from m giving d move i to p if d < 0 then add p k giving j performuntil j > n compute temp1 = j + d move z(j) to z(temp1) add 1 to j end-perform else if d > 0 then move n to j performuntil j < p + k compute temp1 = j + d move z(j) to z(temp1) add 1 to j end-perform add d to n move 1 to j performuntil j > m move z(j) to z(p) add 1 to p add 1 to j end-perform end-if. end-program substitute.
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.