Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

REPLINS$ returns  returns a modified document

Syntax

REPLINS$(Document$, Search$, InsRepDoc$, Pos%, [Mode%=0,1])

Arguments

  • Document$ is a string expression containing a source document
  • 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$ (Pos% = 0)or to be inserted on a specific location indicated by Pos% and marked bySearch$
  • Pos% is the position in Document$:

...

  1. REPLINS$ returns a document on which Remove and Insert operations are performed.
  2. When Search$ = "NullString", sentences will be inserted based on the position defined by Pos% (see examples)
  3. Please look at the MARK$() function to replace parameters in a data set.
  4. The use of REPLINS$() in combination with other string/text manipulation functions will provide flexible means to process text data.

...

Add Mere anarchy is loosed upon the world after the first sentence:

Pos% = 1

Search$ = "NullString"

InsRepDoc$ = "Mere anarchy is loosed upon the world"

...

Document4$ = REPLINS$(Document3$, "NullString", "Mere anarchy is loosed upon the world", 1)

...

Add Turning and turning in the widening gyre two lines before the first sentence:

Pos% = -2

Search$ = "NullString"

InsRepDoc$ = "Turning and turning in the widening gyre"  

...

Document5$ = REPLINS$(Document4$, "NullString", "Turning and turning in the widening gyre", -2)

...

"The Second Coming 

Turning and turning in the widening gyre 
The falcon cannot hear the falconer; 
Things fall apart; the centre cannot hold; 
Mere anarchy is loosed upon the world 
The blood-dimmed tide is loosed, and everywhere"


 

Quick links: Function overview | Attribute overview | Constants overview | Dimensions overview