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 Debugger Dim Value Dim VariableName
' get debugger - is always debugger of index 0 in workspace set Debugger = Workspace.CoreDebugger(0)
' Get the content of the following variable name (for example "ucMinutes") VariableName="ucMinutes"
' Get variable value Value = Debugger.Variable( VariableName )
' change the value Value = Value + 1
' Write new value to the variable Debugger.Variable( VariableName ) = Value
' rerun the application Debugger.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. |