ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

New WINDEV 2024 feature!
Help / WLanguage / WLanguage functions / Controls, pages and windows / 
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Searches for a string or regular expression in the Code Editor control.
Example
CodeEditorDeleteAll(CODEEDT_Example)
sCode is string = [
sFile is string
info(sFile)
]
// Inserts code
CodeEditorInsert(CODEEDT_Example, 1, sCode)

// Searches for a given text in the content of the Code Editor control
arrFind is array of int // Position of each occurrence in the text
CodeEditorSearch(CODEEDT_Example, "info")
IF arrFind.Count > 0 THEN
Info("'info' was found and will be replaced with 'error'.")
END
CodeEditorReplace(CODEEDT_Example, "info", "error")
CODEEDT_Example = [
	HRead("file", 1)
	HReadFirst("file", "item")
]
CodeEditorSearch(CODEEDT_Example, "HRead[a-zA-Z]*", byRegularExpression, CodeEditorSearch_Callback)
	INTERNAL PROCEDURE CodeEditorSearch_Callback(Position int, Length int)
		Trace(Position + " -> " + Length)
	END
Syntax

Searching for text and getting its position Hide the details

<Result> = CodeEditorSearch(<Code Editor control> , <Text> [, <Options>])
<Result>: WLanguage array
Array containing the positions of the search text.
<Code Editor control>: Control name
Name of the Code Editor control to be used.
<Text>: Character string
Text or regular expression to search for.
<Options>: Optional Integer constant
Search options:
byRegularExpressionRegular expression search. In this case, the <Text> parameter must be a regular expression.
IgnoreCaseCase and accent insensitive search (ignores uppercase and lowercase differences).
WholeWordWhole word search (enclosed in punctuation characters or spaces).

By default, search is case-sensitive.

Searching for text and running a procedure on each occurrence Hide the details

CodeEditorSearch(<Code Editor control> , <Text> , <Options> , <WLanguage procedure>)
<Code Editor control>: Control name
Name of the Code Editor control to be used.
<Text>: Character string
Text or regular expression to search for.
<Options>: Integer constant
Search options:
byRegularExpressionRegular expression search. In this case, the <Text> parameter must be a regular expression.
IgnoreCaseCase and accent insensitive search (ignores uppercase and lowercase differences).
WholeWordWhole word search (enclosed in punctuation characters or spaces).
<WLanguage procedure>: Procedure name
Name of the WLanguage procedure ("callback") called for each occurrence. For more details on this procedure, see Parameters of the procedure used by CodeEditorSearch.
Business / UI classification: UI Code
Component: wd290obj.dll
Minimum version required
  • Version 2024
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/07/2024

Send a report | Local help