Rosetta Code/Fix code tags: Difference between revisions

→‎{{header|REXX}}: changed some literals so that HTML parser doesn't get confused.
m (→‎{{header|REXX}}: added/changed comments and whitespace, changed indentations.)
(→‎{{header|REXX}}: changed some literals so that HTML parser doesn't get confused.)
Line 730:
=={{header|REXX}}==
<lang rexx>/*REXX program fixes (changes) depreciated HTML code tags with newer tags. */
@="<"; old.=; @ old.1 = @'<%s>' ; new.1 = @"<lang %s>"
@ old.2 = @'</%s>' ; new.2 = @"</lang>"
@ old.3 = @'<code %s>' ; new.3 = @"<lang %s>"
@ old.4 = @'</code>' ; new.4 = @"</lang>"
 
iFID = 'Wikisource.txt' /*the Input File IDentifier. */
Line 739:
 
do while lines(iFID)\==0 /*keep reading the file until finished.*/
_$=linein(iFID) /*read a record from the input file. */
do j=1 while @old.j \== '' /*change old ──► new until finished. */
_$=changestr(@old.j,_$,new.j) /*let REXX do the heavy lifting. */
end /*j*/
call lineout oFID,_$ /*write re-formatted record to output. */
end /*while*/ /*stick a fork in it, we're all done. */</lang>
Some older REXXes don't have a &nbsp; '''changestr''' &nbsp; BIF, so one is included here &nbsp; ───► &nbsp; [[CHANGESTR.REX]].