Rosetta Code/Fix code tags: Difference between revisions
Content added Content deleted
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: | Line 730: | ||
=={{header|REXX}}== |
=={{header|REXX}}== |
||
<lang rexx>/*REXX program fixes (changes) depreciated HTML code tags with newer tags. */ |
<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. */ |
iFID = 'Wikisource.txt' /*the Input File IDentifier. */ |
||
Line 739: | Line 739: | ||
do while lines(iFID)\==0 /*keep reading the file until finished.*/ |
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, |
call lineout oFID,$ /*write re-formatted record to output. */ |
||
end /*while*/ /*stick a fork in it, we're all done. */</lang> |
end /*while*/ /*stick a fork in it, we're all done. */</lang> |
||
Some older REXXes don't have a '''changestr''' BIF, so one is included here ───► [[CHANGESTR.REX]]. |
Some older REXXes don't have a '''changestr''' BIF, so one is included here ───► [[CHANGESTR.REX]]. |