How can I automatically change a variable and rerun my application after it was halted at a breakpoint?
Create a script file, that contains the appropriate procedure:
Sub ChangeVariableAndRun()
Dim UDEDebugger
Dim Value
Dim VariableName
' Get debugger - is always debugger of index 0 in workspace
set UDEDebugger = Workspace.CoreDebugger(0)
' Get the content of the following variable name (for example "ucMinutes")
VariableName="ucMinutes"
' Get variable value
Value = UDEDebugger.Variable( VariableName )
' Change the value
Value = Value + 1
' Write new value to the variable
UDEDebugger.Variable( VariableName ) = Value
' Return the application
UDEDebugger.Go()
End Sub
- Start UDE
- Load/Create your workspace
- Click on Tools - Macros - Open File to open the Script file that contains your procedure
- Load the ELF application and source file
- Set a breakpoint to the appropriate source line
- Click on Debug - Breakpoints... from the UDE menu
- Select the breakpoint on which the variable name have to be changed
- Enable the Macro checkbox
- Enter the procedure name, that is enclosed in your script file (for example
ChangeVariableAndRun) - Click on OK to save all.
After click on Run, the procedure is always called after the appropriate breakpoint was hit.