4D View v16

PV REPLACE ONE

Home

 
4D View v16
PV REPLACE ONE

PV REPLACE ONE 


 

PV REPLACE ONE ( area ; string ; replace ; where ; contains {; column ; row} ) 
Parameter Type   Description
area  Longint in 4D View area
string  String in String to replace
replace  String in Replacement string
where  Integer in 0 = Formulas; 1 = Values
contains  Integer in 0 = Contains; 1 = Equals
column  Longint in Starting cell column number
in Found cell column number
row  Longint in Starting row column number
in Found cell row number

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 VAT rate with a new reference (new rate).

 C_LONGINT($Where//0=Formula / 1=Value
 C_LONGINT($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

 
PROPERTIES 

Product: 4D View
Theme: PV Cell manipulation
Number: 15960

 
HISTORY 

Created: 4D View 6.8

 
ARTICLE USAGE

4D View Language ( 4D View v16)