PatchLines (Stringlist function)
Apply patch Stringlist to a base Stringlist (Stringlist class)
This method uses Unix-style diff output to update text lines that are stored in a Stringlist.
PatchLines applies a given patch file (converted to a Stringlist) to a base file (also a Stringlist), and it returns an output Stringlist that is the base file updated by the differences contained in the patch file. PatchLines has the same functionality as the Patch method, but its syntax is slightly different: it reverses the method object and principal arguments of Patch. In PatchLines, the patch file Stringlist is the method object and the base file Stringlist is the principal method argument; in Patch the base file Stringlist is the method object and the patch file Stringlist is a method argument. Both PatchLines and Patch support only a line-oriented patch.
For usage notes and an example, see the Patch description. For working with character-oriented diff output, use the PatchString method.
%updList = sl:PatchLines( baseList, [Options= string])
|%updList||A Stringlist object that reproduces the original updated file, that is, baseList updated by the sl updates.|
|sl||A Stringlist object that contains the patch file (one line per sl item).|
|baseList||A Stringlist object that contains the original base file, each line stored as a individual baseList item.|
|Options||This optional argument (name required) is the string value |
- PatchLines is available as of Sirius Mods Version 7.2.
- diff for creation of the patch file StringList.
- Patch for usage notes and examples.
- PatchString for working with character-oriented diff output.