ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Controls, pages and windows / Code Editor functions
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Finds and replaces a string in the Code Editor control.
New in version 2025
WEBDEV - Browser code This function is now available in browser code.
Example
// Replaces calls to Info with calls to Trace
CodeEditorReplace(CODEEDT_NoName1, "Info", "Trace", WholeWord)
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")
Syntax
CodeEditorReplace(<Code Editor control> , <Text to find> , <New text> [, <Options>])
<Code Editor control>: Control name
Name of the Code Editor control to be used.
<Text to find>: Character string
Text to find.
<New text>: Character string
Replacement text.
<Options>: Optional Integer constant
Search options for the word to be replaced:
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.
Business / UI classification: UI Code
Component: wd300obj.dll
Minimum version required
  • Version 2024
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 09/25/2024

Send a report | Local help