VP Find
VP Find ( rangeObj : Object ; searchValue : Text ) : Object
VP Find ( rangeObj : Object ; searchValue : Text ; searchCondition : Object } ) : Object
VP Find ( rangeObj : Object ; searchValue : Text ; searchCondition : Object ; replaceValue : Text ) : Object
Parâmetro | Tipo | Descrição | ||
---|---|---|---|---|
rangeObj | Object | -> | Objeto intervalo | |
searchValue | Text | -> | Valor da pesquisa | |
searchCondition | Object | -> | Objeto que contém condição(ões) de pesquisa | |
replaceValue | Text | -> | Valor de substituição | |
Resultados | Object | <- | Objeto intervalo |
Descrição
O comando VP Find
pesquisa o rangeObj para o searchValue. Podem ser utilizados parâmetros opcionais para refinar a pesquisa e/ou substituir quaisquer resultados encontrados.
No parâmetro rangeObj, passe um objeto que contenha um intervalo a ser pesquisado.
O parâmetro searchValue permite que você passe o texto a ser pesquisado dentro do rangeObj.
You can pass the optional searchCondition parameter to specify how the search is performed. As propriedades abaixo são compatíveis:
Propriedade | Tipo | Descrição | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
afterColumn | Integer | O número da coluna imediatamente anterior à coluna inicial da pesquisa. If the rangeObj is a combined range, the column number given must be from the first range. Valor padrão: -1 (início do rangeObj) | ||||||||
afterRow | Integer | O número da linha imediatamente anterior à linha inicial da pesquisa. Se rangeObj for um intervalo combinado, o número da linha fornecido deverá ser do primeiro intervalo. Valor padrão: -1 (início do rangeObj) | ||||||||
all | Parâmetros | |||||||||
flags | Integer |
$search.flags:=vk find flag use wild cards+vk find flag ignore case | ||||||||
order | Integer |
| ||||||||
target | Integer |
These flags can be combined. Por exemplo: |
In the optional replaceValue parameter, you can pass text to take the place of any instance of the text in searchValue found in the rangeObj.
Objecto devolvido
A função retorna um objeto de intervalo que descreve cada valor de pesquisa que foi encontrado ou substituído. É devolvido um objeto de intervalo vazio se não forem encontrados resultados.
Exemplo 1
Para encontrar a primeira célula que contém a palavra "Total":
var $range;$result : Object
$range:=VP All("ViewProArea")
$result:=VP Find($range;"Total")
Exemplo 2
Para encontrar "Total" e substituí-lo por "Total geral":
var $range;$condition;$result : Object
$range:=VP All("ViewProArea")
$condition:=New object
$condition.target:=vk find target text
$condition.all:=True //Search entire document
$condition.flags:=vk find flag exact match
// Replace the cells containing only 'Total' in the current sheet with "Grand Total"
$result:=VP Find($range;"Total";$condition;"Grand Total")
// Check for empty range object
If($result.ranges.length=0)
ALERT("No result found")
Else
ALERT($result.ranges.length+" results found")
End if