WR O Replace

4D - Documentation   Français   English   German   4D Write, Command Theme List   4D Write, Command Alphabetical List   4D Write, Constant Theme List   Back   Previous   Next

version 6.0


WR O Replace (area; old; new; where; method; mode) Longint

ParameterTypeDescription
areaLongint4D Write area
oldTextString to search for
newTextString to replace it with
whereInteger0=Partial word
1=Whole word
methodInteger0=Not case sensitive
1=Case sensitive
modeInteger0=Replace next
1=Replace all
Function resultLongintNumber of replacements

Note 6.5: This command was only maintained for compatibility purposes. We recommend using the WR Replace command.

Description

The command WR O Replace searches for occurrences of old in area and replaces them with new. This function also returns the number of replacements. WR O Replace begins replacing from the position of the last character in the selected text.

Where determines whether old can match only whole words. If where equals 0, WR O Replace replaces old if old is part of a word. If where equals 1, WR O Replace replaces old only if old is a whole word. A whole word is a word surrounded by separator characters such as spaces or punctuation marks.

method determines whether or not the replacement will be case sensitive. If method equals 0, WR O Replace replaces old regardless of case. If method equals 1, WR O Replace replaces old only if the cases match.

mode determines how many replacements will be made.

If mode equals 0, only the next occurrence of old is replaced. If mode equals 1, all occurrences of old are replaced with new, regardless of the position of the selected text.

See Also

WR Replace.


4D - Documentation   Français   English   German   4D Write, Command Theme List   4D Write, Command Alphabetical List   4D Write, Constant Theme List   Back   Previous   Next