PC SOFT - Online help
Version: 18.0
Community: 0 annotation | Annotate RSS feed
Warning: Content of this document will be soon extended. Warning: Content of this document will be soon extended.
This page is also available for: WINDEV, Report & Queries
Displayed version:
RTFSearch (Function)
In French: RTFRecherche

 
WinDev WebDev - Server code WebDev - Browser code WinDev Mobile Reports and Queries   Windows Linux Windows Mobile Windows Phone Android Android Widget iPhone/iPad Windows Store apps   Java PHP Ajax User code (UMC) External language   HyperFileSQL HyperFileSQL Client/Server Stored procedures Hyper File 5.5 OLE DB ODBC Native Accesses

Searches for a character string in an RTF control (found in a window or in a WinDev report) or in a character string containing text in RTF format.
 
// Switch all the occurrences of "WinDev" found in a text in red and underlined
I is int
I = RTFSearch(EDT_Edit1, "WinDev")
WHILE I>0
// Switch to red
RTFSélection(EDT_Edit1, rtfColor, LightRed, I, 6)
// Switch to underlined
RTFSélection(EDT_Edit1, rtfUnderlined, True, I, 6)
// find the next occurrence of "WinDev"
I = RTFSearch(EDT_Edit1, "WinDev", rtfCaseSensitive, I+1)
END

nRes is int
sString is string = EDT_Edit1
// ****** USES A STRING VARIABLE
// Find the words containing the string "RTF"
nRes = RTFSearch(sString, "RTF", rtfFullWord, 1)
WHILE nRes <> 0
nRes = RTFSearch(sString, "RTF", rtfFullWord, nRes+3))
END

<Result> = RTFSearch(<RTF Control or String> , <String to Find> [, <Options> [, <Start>]])

<Result>: Integer
  • Position of the first character of the character string sought in the initial string.
  • 0 if the sought string is not found.
The RTF formatting is ignored.
<RTF Control or String>: Character string (with or without quotes)
Name of the RTF control or RTF string in which the search must be performed.
<String to Find>: Character string
Character string that must be found in the control or in the string.
<Options>: Optional constant (or combination of constants)
Indicates the parameters for the search:

rtfCaseSensitiveThe search is case sensitive.
rtfFullWordOnly the full words are sought.
<Start>: Optional integer
Position of the character from which the specified string is sought. If this parameter is not specified, the search starts from the end of the selected text and continues until the end of the text in the control or string.

Searching for the character string

By default, the search is case insensitive and all the specified characters are sought.

The search is performed from the end of the selection (position of the mouse cursor) until the end of the text found in the control or string.

 
Components :
WinDev Reports and Queries wd180obj.dll
 
 
Minimum required version: 9
Community: 0 annotation RSS feed
Please login to annotate | Terms of service