Task

Replace every occurring instance of a piece of text in a group of text files with another one.



For this task we want to replace the text   "Goodbye London!"   with   "Hello New York!"   for a list of files.




File_Open("files.lst")          // list of files to process
#20 = Reg_Free                  // text register for filename
 
While(!At_EOF) {
    Reg_Copy_Block(#20, Cur_Pos, EOL_Pos)
    File_Open(@(#20))
    Replace("Goodbye London!", "Hello New York!", BEGIN+ALL+NOERR)
    Buf_Close(NOMSG)
    Line(1, ERRBREAK)
}
 
Reg_Empty(#20)                  // Cleanup
Buf_Quit(OK)