Basic IDE problem: If we place variable which returns value from function to Watch window, it not working. Always tells "Out of scope" Steps to reproduce: 0. Start any LO module, for example, Writer 1. Press Alt-F11, in dialog "LibreOffice Basic Macros" press "New" and then "Ok" 2. In Basic IDE enter something like this: Sub Main c=MySum(1,2) End Sub Function MySum (a as Integer, b as Integer) MySum=0 MySum=a+MySum MySum=MySum*10 MySum=b+MySum End Function 3. Place cursor on word MySum and press F7. This variable added to Watch window 4. Place cursor on line where is MySum=0 and press F9. BreakPoint added 5. Place cursor on line where Sub Main and press F5 6. Press F8 several times and see on Watch window Expected: value of variable MySum is shown Actually: always "Out of scope" reproduced in 3.4.2 on Windows XP 32 bit and in 3.6.3 on RFR 17 64 bit Workaround: create new variable and use it for all calculations, then assign result to returning variable in last line of function
Confirmed with 12/20 build of dev master. Always <Out of scope>. The lexical scope of the function name is file/module scope. IIRC, some time ago, Noel Power told me that some module scope objects have this issue. Moved to NEW. Tested global vars (working) and const items (don't work) with the following: global SomeTweak as integer const TweakToo = 2 Sub Main SomeTweak = 1 c=MySum(1,2) MsgBox c End Sub public Function MySum (a as Integer, b as Integer) MySum=SomeTweak+TweakToo MySum=a+MySum MySum=MySum*10 MySum=b+MySum End Function I know watching a const isn't very useful but there may be even more BASIC constructs that have this issue of falsely reporting <out of scope> in the Watch Window.
More generally, want to be able to watch expressions that include functions, in scope vars and values from the object model. For example the following should show true, false, <type error>?, in addition to <out of scope> where appropriate: oSheet.Cells(r,c).value = 3 . Will look at this while working on 57307.
** Please read this message in its entirety before responding ** To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year. There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present. If you have time, please do the following: Test to see if the bug is still present on a currently supported version of LibreOffice (4.3.5 or later): https://www.libreoffice.org/download/ If the bug is present, please leave a comment that includes the version of LibreOffice and your operating system, and any changes you see in the bug behavior If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a short comment that includes your version of LibreOffice and Operating System Please DO NOT Update the version field Reply via email (please reply directly on the bug tracker) Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not appropriate in this case) Thank you for your help! -- The LibreOffice QA Team
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.