Rosetta Code/Fix code tags: Difference between revisions
Content added Content deleted
m (→{{header|REXX}}: re-aligned first comment, added whitespace. -- ~~~~) |
(→{{header|REXX}}: changed comments and indentation, added a comment. -- ~~~~) |
||
Line 347: | Line 347: | ||
=={{header|REXX}}== |
=={{header|REXX}}== |
||
⚫ | |||
<lang rexx>/*REXX program fixes (changes) depreciated code tags with newer tags.*/ |
<lang rexx>/*REXX program fixes (changes) depreciated code tags with newer tags.*/ |
||
⚫ | |||
old. = /*define a default value for OLD.*/ |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
ifid = 'Wikisource.txt' /* input file identifier. */ |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
_=linein(ifid) /*read a record from the input. */ |
_=linein(ifid) /*read a record from the input. */ |
||
do k=1 while old.j\=='' |
do k=1 while old.j\=='' /*change old --> new until done. */ |
||
_=changestr(new.k,_,old.k) /*let REXX do the heavy lifting. */ |
_=changestr(new.k,_,old.k) /*let REXX do the heavy lifting. */ |
||
end |
end /*k*/ |
||
call lineout ofid,_ /*write out the re-formatted rec.*/ |
call lineout ofid,_ /*write out the re-formatted rec.*/ |
||
end |
end /*while lines(ifid)\==0*/ |
||
/*stick a fork in it, we're done.*/</lang> |
|||
⚫ | |||
/*───────────────────────────CHANGESTR subroutine───────────────────────*/ |
<lang rexx>/*───────────────────────────CHANGESTR subroutine───────────────────────*/ |
||
changestr: procedure; parse arg o,h,n; r=; w=length(o); if w==0 then return n||h |
changestr: procedure; parse arg o,h,n; r=; w=length(o); if w==0 then return n||h |
||
do forever; parse var h y (o) _ +(w) h; if _=='' then return r||y; r=r||y||n; end</lang> |
do forever; parse var h y (o) _ +(w) h; if _=='' then return r||y; r=r||y||n; end</lang> |