4D View v16

PV FIND ONE

Home

 
4D View v16
PV FIND ONE

PV FIND ONE 


 

PV FIND ONE ( area ; criteria ; where ; contains {; column ; row } ) 
Parameter Type   Description
area  Longint in 4D View area
criteria  String in String to query
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 cell row number
in Found cell row number

The PV FIND ONE command searches for criteria among the cells of the area. The search will stop at the first cell, if any, that meets the search criteria.

criteria specifies the character string to query.

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 starts 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 left to right, beginning with the indicated cell.

After executing the command, the first cell eventually found becomes the new current cell. If they were called, the column and row parameters then contain coordinates.

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

Example  

Let's query the first cell containing the user response to an initial request. The query will start in the cell B3.

 C_TEXT($Criteria//String to query
 C_LONGINT($QueryWhere//0=Formulas / 1=Values
 C_LONGINT($Contains//0=Equals / 1=Contains
 C_LONGINT($Column//Column number of found cell
 C_LONGINT($Row//Row number of found cell
 
 $Criteria:=Request("What value should be queried?";"x")
 
 If($Criteria#"") //Defined criteria
    CONFIRM("Query formulas or values?";"Values";"Formulas")
    $QueryWhere:=OK //0=Formulas / 1=Values
 
    CONFIRM("What kind of comparison?";"Contains";"=")
    $Contains:=OK //0=Contains / 1=Equals
 
    $Column:=2 //Search starting from cell B3
    $Row:=3
 
    PV FIND ONE(Area;$Criteria;$QueryWhere;$Contains;$Column;$Row//Query
 End if



See also 

PV FIND ALL
PV REPLACE ONE

 
PROPERTIES 

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

 
HISTORY 

Created: 4D View 6.8

 
ARTICLE USAGE

4D View Language ( 4D View v16)