PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Finding the character string
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Finds 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.
Example
// Switch all the occurrences of "WINDEV" in red and underlined
I is int
I = RTFSearch(EDT_Edit1, "WINDEV")
WHILE I > 0
// Switch to red
RTFSelection(EDT_Edit1, rtfColor, LightRed, I, 6)
// Switch to underlined
RTFSelection(EDT_Edit1, rtfUnderlined, True, I, 6)
// Find the next "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 "RTF" string
nRes = RTFSearch(sString, "RTF", rtfFullWord, 1)
WHILE nRes <> 0
nRes = RTFSearch(sString, "RTF", rtfFullWord, nRes + 3)
END
Syntax
<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 where the search will 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.
Remarks

Finding 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
WINDEVReports and Queries wd230obj.dll
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment