Ask Your Question
0

Why are variable values not displayed or updated in the BASIC IDE watch window? [closed]

asked 2016-04-11 19:16:48 +0200

lancecycles gravatar image

updated 2016-04-11 20:41:09 +0200

I have the following code in my macro:

REM BASIC

Sub Main

Dim Xfac as Integer
Dim x as Integer
Dim i as Integer
X=1
Xfac=5
For i=1 to Xfac
    x=x*i
Next i
Msgbox "Factorial " + Xfac + " = " + X

End Sub

I can add the variables to the watch window, but no value or type is displayed when the macro is run. Nor can I click on a variable in the watch window to change it's value.

Is this a BUG or am I doing something incorrectly?

LO v5.1.2 on Windows 7.

Thanks for the help.

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by lancecycles
close date 2016-04-14 19:29:37.955933

1 Answer

Sort by » oldest newest most voted
0

answered 2016-04-11 22:18:39 +0200

Ratslinger gravatar image

Set a breakpoint in your code (a place to stop & examine) such your x=1 line. Do this by placing cursor on that line & hit F9 key. Start the macro execution. It will stop at that line. Now you can proceed line by line using the F8 key and you will see your results. Step out of the routine with Ctl-Shift-F8 or step into a routine with Shift-F8. You can also use defined buttons on the toolbar instead of the keyboard.

edit flag offensive delete link more

Comments

Thank you Ratslinger, That worked. It's odd though.....I googled to try and find an answer and none of the things I found mentioned that breakpoints are required to use the watch window.

lancecycles gravatar imagelancecycles ( 2016-04-11 22:39:13 +0200 )edit

If you think about it, since your variables are private (visible only in the Sub) once it executes there is nothing to look at. Additionally, if you want to change a value the system needs a pause to allow this to be done.

Ratslinger gravatar imageRatslinger ( 2016-04-11 23:09:21 +0200 )edit

Question Tools

1 follower

Stats

Asked: 2016-04-11 19:16:48 +0200

Seen: 47 times

Last updated: Apr 11 '16