Jump to content

Rosetta Code/Fix code tags: Difference between revisions

→‎{{header|REXX}}: fixed bad WHILE clause in DO loop, added whitespace, changed comments. -- ~~~~
(added "go" to language list.)
(→‎{{header|REXX}}: fixed bad WHILE clause in DO loop, added whitespace, changed comments. -- ~~~~)
Line 437:
 
=={{header|REXX}}==
 
<lang rexx>/*REXX program fixes (changes) depreciated code tags with newer tags.*/
@ = '<' /*ensure RC wondoesn't get confused. */
old. = /*define a default value for OLD.*/
old.1 = @'%s>' ; new.1 = @'lang %s>'
Line 446 ⟶ 445:
old.4 = @'/code>' ; new.4 = @'/lang>'
 
ifid = 'Wikisource.txt' /* inputInput fileFile identifierIDentifier. */
ofid = 'converted.txt' /*outputOutput " " */
 
do while lines(ifid) \== 0 /*keep trunkin' until it's done. */
_=linein(ifid) /*read a record from theinput inputfile. */
 
do kj=1 while old.j \== '' /*change old -->──► new until done. */
_=changestr(new.kj,_,old.kj) /*let REXX do the heavy lifting. */
end /*kj*/
 
call lineout ofid,_ /*write out the re-formatted recrecord. */
end /*while lines(ifid)\==0...*/
/*stick a fork in it, we're done.*/</lang>
Some older REXXes don't have the '''changestr''' bif, so one is include below.
Cookies help us deliver our services. By using our services, you agree to our use of cookies.