...
- Document$ is a string expression containing a source document
- Search$ is Search% is a string expression containing a search string which is to be replaced or marks a spot in Document$. Can be "NullString" to insert sentences (see remarks and examples).
- InsRepDoc$ is a string expression containing either a string or a document, replacing Search$ replacing Search% (Pos% = 0)or to be inserted on a specific location indicated by Pos% and marked bySearch$bySearch%
- Pos% is the position in Document$:
- Pos% = 0 is a search and replace;
- Pos% = 1 place immediately behind Search$behind Search%
- Pos% = -1 place immediately before Search$before Search%
- Mode% = 0 or no value - case sensitive search operation
- Mode% = 1 - case insensitive search operation
...
- REPLINS$ returns a document on which Remove and Insert operations are performed.
- When Search$ When Search% = "NullString", sentences will be inserted based on the position defined by Pos% (see examples)
- Please look at the MARK$() function to replace parameters in a data set.
- The use of REPLINS$() in combination with other string/text manipulation functions will provide flexible means to process text data.
...
Replace lost with loosed:
Pos% = 0
Search$ Search% = "lost"
InsRepDoc$ = "lost"
...
Add , and immediately behind loosed:
Pos% = 1
Search$ Search% = "loosed"
InsRepDoc$ = ", and"
...
Add -dimmed immediately before tide, including the space, so make sure to define " tide":
Pos% = -1
Search$ Search% = " tide"
InsRepDoc$ = ", -dimmed"
...
Add Mere anarchy is loosed upon the world after the first sentence:
Pos% = 1
Search$ Search% = "NullString"
InsRepDoc$ = "Mere anarchy is loosed upon the world"
...
Add Turning and turning in the widening gyre two lines before the first sentence:
Pos% = -2
Search$ Search% = "NullString"
InsRepDoc$ = "Turning and turning in the widening gyre"
...
Pos% = 2: the insert will be done (Pos%-1) lines after the line with Search$with Search%
Search$ Search% = "widening"
InsRepDoc$ = "The falcon cannot hear the falconer;"
...
Pos% = -2: the insert will be done -2 lines before the line with Search$with Search%
Search$ Search% = "widening"
InsRepDoc$ = "The Second Coming"
...