|
|
|
|
- Overview
- Manipulating Code Editor controls programmatically
- Initializing the Code Editor control
- Allowing and disallowing functions in the Code editor control
- Making a selection in the Code editor control
- Undo / Redo support
- Properties specific to Code Editor controls
Manipulating Code Editor controls programmatically
WINDEV offers various Code Editor control functions to manipulate Code Editor controls programmatically. This help page explains how to manipulate a Code Editor control programmatically. Manipulating Code Editor controls programmatically To manipulate a Code Editor control programmatically, simply use the variable that represents the control directly in the code. The variable that represents the Code Editor control is the name of the control. Initializing the Code Editor control To assign WLanguage code to the Code Editor control programmatically, you can: - directly assign a multiline string. For example:
CODEEDT_Example = [
Res is string
StringToConvert is string = "Crème brûlée"
Res = AnsiToOem(StringToConvert)
Info(Res)
]
- use the CodeEditorLoad function. This function loads WLanguage code from a file.
Allowing and disallowing functions in the Code editor control The Compiler property gets and sets the compiler options in the Code Editor control, in particular, which functions are allowed or disallowed. In the following example, all WLanguage functions are allowed, except fDelete:
CODEEDT_Example.Compiler.AllowedFunctions = AllFunctions
CODEEDT_Example.Compiler.ForbiddenFunctions = "fDelete"
Making a selection in the Code editor control The Cursor and CursorEnd properties can be used to make a simple selection in the Code Editor control. Undo / Redo support You can implement the Undo/Redo functionality in the Code Editor control using AAFExecute with the aafUndo and aafRedo constants. Example:
AAFExecute(CODEEDT_MyCode, aafUndo)
AAFExecute(CODEEDT_MyCode, aafRedo)
Properties specific to Code Editor controls The following properties are used to manipulate Code Editor controls programmatically. | | | The Compiler property gets and sets the compiler options in the Code Editor control, in particular, which functions are allowed or disallowed. | | The LineCursor property gets and sets the number of the line where the cursor is located in a Code Editor control. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|