Command PV REPLACE ONE

4D View

PV REPLACE ONE

version 6.8


PV REPLACE ONE (area; string; replace; where; contains{; column; row})

ParameterTypeDescription
areaLongint4D View area
stringStringString to replace
replaceStringReplacement string
whereInteger0 = Formulas; 1 = Values
containsInteger0 = Contains; 1 = Equals
columnLongintStarting cell column number
Found cell column number
rowLongintStarting row column number
Found cell row number

Description

The PV REPLACE ONE command replaces character string with replace in the first cell in area that corresponds to the query criteria defined using where or contains, starting from the cell set by column and row.

string specifies the character string to search and replace with replace.

where indicates which part of the spreadsheet to query:

• 0: Queries formulas

• 1: Queries values

contains defines the type of comparison:

• 0: Partial (contains the queried value)

• 1: Total (equal to the queried value)

If the column and row optional parameters are omitted, the search begins at the top left corner of the area. If column and row are passed, they indicate the cell of the area from which the search will begin.

The search is carried out from top to bottom and then from left to right beginning with the starting cell.

After execution of the command, the first cell found, if any, becomes the new current cell. If they were called, the column and row parameters will then contain the coordinates of this new cell.

If no cell was found during the search, the current cell remains unchanged.

Example

Replace the first occurrence of the current T.V.A. rate with a new reference (new rate).


   C_INTEGER($Where)  `0=Formula / 1=Value
   C_INTEGER($Contains)  `0=Contains / 1=Equals

   $Where:=0  `Replacement formula
   $Contains:=0  `Contains

      `Replace first instance
   PV REPLACE ONE (Area;"$C$30";"$C$31";$Where;$Contains)

See Also

PV FIND ONE, PV REPLACE ALL.