Rosetta Code/Fix code tags: Difference between revisions

m
→‎{{header|REXX}}: added/changed comments and whitespace, changed indentations.
m (added whitespace before the TOC (table of contents), added a ;Task: and ;Usage: (bold) headers.)
m (→‎{{header|REXX}}: added/changed comments and whitespace, changed indentations.)
Line 729:
 
=={{header|REXX}}==
<lang rexx>/*REXX program fixes (changes) depreciated HTML code tags with newer tags. */
@ .=; '<' @.1 = '<%s>' ; new.1 = "<lang /*ensure RC doesn't get confused.*/%s>"
old. = @.2 = '</%s>' ; new.2 = /*define a default value for OLD.*"</lang>"
old.1 = @'%s>' @.3 = '<code %s>' ; new.13 = @'"<lang %s>'"
old.2 = @'/%s>' @.4 = '</code>' ; new.24 = @'"</lang>'"
old.3 = @'code %s>' ; new.3 = @'lang %s>'
old.4 = @'/code>' ; new.4 = @'/lang>'
 
ifidiFID = 'Wikisource.txt' /*the Input File IDentifier. */
ofidoFID = 'converted.txt' /*the Output " " */
 
do while lines(ifidiFID) \== 0 /*keep trunkin'reading untilthe it'sfile done.until finished.*/
_=linein(ifidiFID) /*read a record from the input file. */
do j=1 while @.j \== '' /*change old ──► new until finished. */
 
do j=1 while old _=changestr(@.j,_,new.j) \== '' /*changelet oldREXX ──►do newthe untilheavy donelifting. */
_=changestr(new.j,_,old.j) /*let REXX do the heavy lifting. end /*j*/
call lineout oFID,_ call lineout ofid,_ /*write the re-formatted record to output. */
end /*j*/
end /*while*/ /*stick a fork in it, we're all done. */</lang>
 
Some older REXXes don't have a &nbsp; '''changestr''' bif&nbsp; BIF, so one is included here &nbsp; ───► &nbsp; [[CHANGESTR.REX]].
call lineout ofid,_ /*write the re-formatted record. */
end /*while lines(ifid...*/
/*stick a fork in it, we're done.*/</lang>
Some older REXXes don't have a '''changestr''' bif, so one is included here ───► [[CHANGESTR.REX]].
<br><br>