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
Reproduced. Win 7 Pro 64-bit Version: 4.5.0.0.alpha0+ Build ID: 784d069cc1d9f1d6e6a4e543a278376ab483d1eb TinderBox: Win-x86@62-TDF, Branch:MASTER, Time: 2015-01-25_23:07:36
** 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 (5.0.5 or 5.1.0) 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) If you want to do more to help you can test to see if your issue is a REGRESSION. To do so: 1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) http://downloadarchive.documentfoundation.org/libreoffice/old/ 2. Test your bug 3. Leave a comment with your results. 4a. If the bug was present with 3.3 - set version to "inherited from OOo"; 4b. If the bug was not present in 3.3 - add "regression" to keyword Feel free to come ask questions or to say hello in our QA chat: http://webchat.freenode.net/?channels=libreoffice-qa Thank you for your help! -- The LibreOffice QA Team This NEW Message was generated on: 2016-02-21
** 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 (5.2.5 or 5.3.0 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) If you want to do more to help you can test to see if your issue is a REGRESSION. To do so: 1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) http://downloadarchive.documentfoundation.org/libreoffice/old/ 2. Test your bug 3. Leave a comment with your results. 4a. If the bug was present with 3.3 - set version to "inherited from OOo"; 4b. If the bug was not present in 3.3 - add "regression" to keyword Feel free to come ask questions or to say hello in our QA chat: http://webchat.freenode.net/?channels=libreoffice-qa Thank you for helping us make LibreOffice even better for everyone! Warm Regards, QA Team MassPing-UntouchedBug-20170306
https://opengrok.libreoffice.org/xref/core/basic/source/comp/dim.cxx?r=9e6ca513#1221 https://opengrok.libreoffice.org/xref/core/basic/source/comp/codegen.cxx?r=754c6af4#275 https://opengrok.libreoffice.org/xref/core/basic/source/classes/sbxmod.cxx?r=889dc7bf#490 https://opengrok.libreoffice.org/xref/core/basctl/source/basicide/baside2b.cxx?r=8bf1542f#2412 https://opengrok.libreoffice.org/xref/core/basctl/source/basicide/baside2b.cxx?r=8bf1542f#IsSbxVariable https://opengrok.libreoffice.org/xref/core/basic/source/runtime/runtime.cxx?r=889dc7bf#633 https://opengrok.libreoffice.org/xref/core/basic/source/runtime/runtime.cxx?r=889dc7bf#572 not sure but, do really first argument at of refparams->Put have to be the SbMethod itself?
Typo: Do really the first argument of refparams->Put at runtime.cxx:633 have to be the SbMethod itself?
' As Subroutine name is added to the public variable list, the following code runs without errors. Option Explicit Sub Recursive() As Integer End Sub Sub Main() Recursive = 1 End Sub
Hmmm, if the variable with another function name is used, the function with that named seems to be called.
The problem is that if you watch a method/variable, LO tries to retrieve the value of the that variable, which is not yet fully computed. Hence, the watch window always shows out of scope. However, I tried to add: else if (SbxMethod const* pMeth = dynamic_cast<SbxMethod*>(pSBX)) { const SbxValues& pVals = pMeth->GetValues_Impl(); double test = pVals.nDouble; aTypeStr += getBasicTypeName(pMeth->GetType()); } but the test value in this example are always empty.
Proposed patch: https://gerrit.libreoffice.org/c/core/+/124075
Andreas Heinisch committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/f9ce4b2d04b58843d7986acd9382864b0b30d617 tdf#57308 - Basic IDE: Watching of a variable does not work It will be available in 7.3.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
I test the feature extensively on my machine, and I hope it works. However, there could be some circumstances where it could fail. Maybe there will be some regressions where it doesn't work, but it is a starting point.
Tested ofc.
For unknown reason, after "End Function" code goes to MySum=SomeTweak+TweakToo
Version: 7.3.0.0.alpha0+ (x64) / LibreOffice Community Build ID: d80547c7f4ddf599cce52e5c52269cb07a677466 CPU threads: 4; OS: Windows 10.0 Build 19042; UI render: default; VCL: win Locale: ja-JP (ja_JP); UI: en-US Calc: CL
Thx for testing! The problem lies here: If (SbxVariable const* pVar = dynamic_cast<SbxVariable*>(pSBX I should cast it to SbxMethod, otherwise the value will be retrieved which leads to the problem.
Andreas Heinisch committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/514e83a0a548e61753b1238f55ee929c3c799eed Revert "tdf#57308 - Basic IDE: Watching of a variable does not work" It will be available in 7.3.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Andreas Heinisch committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/7d27e4b0257a8a927d3b59edcd549ff9103cbaa9 tdf#57308 - Basic IDE: Watching of a variable does not work It will be available in 7.3.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.