[Libreoffice-bugs] [Bug 140118] New: Incorrect example in Help for BASIC function WaitUntil
bugzilla-daemon at bugs.documentfoundation.org
bugzilla-daemon at bugs.documentfoundation.org
Wed Feb 3 10:56:38 UTC 2021
https://bugs.documentfoundation.org/show_bug.cgi?id=140118
Bug ID: 140118
Summary: Incorrect example in Help for BASIC function WaitUntil
Product: LibreOffice
Version: unspecified
Hardware: All
OS: All
Status: UNCONFIRMED
Severity: trivial
Priority: medium
Component: Documentation
Assignee: libreoffice-bugs at lists.freedesktop.org
Reporter: uwe at franke-auer.de
CC: olivier.hallot at libreoffice.org
Description:
LibreOffice Help page
https://help.libreoffice.org/latest/en-US/text/sbasic/shared/03130610.html?DbPAR=BASIC
contains the following Example for WaitUntil Statement (BASIC)
> REM Wait until 6:00 PM then call MyMacro.
> REM If after 6:00 PM, exit.
> Sub ExampleWaitUntil
> Dim vTimeschedule As Long
> vTimeSchedule = Date() + TimeValue("18:00:00")
> If vTimeSchedule < Now() Then Exit Sub
> WaitUntil vTimeSchedule
> Call MyMacro
> End Sub
This example does not work as intended, due to declaration "Dim vTimeschedule
As Long", which is turning vTimeschedule into integer.
The documentation is incorrect here and requires "Dim vTimeschedule As Double"
to demonstrate what is being intended.
Steps to Reproduce:
1. Open help page LibreOffice Help page
https://help.libreoffice.org/latest/en-US/text/sbasic/shared/03130610.html?DbPAR=BASIC
2. Implement the example given (with some adapted reasonable TimeValue) and
(for testing purpose) replace the "Call Macro" by a MsgBox statement.
3. Start the makro
Actual Results:
[1] You need to wait until midnight (case TimeValue > "12:00:00")
[2] Macro finishes immediately (case TimeValue < "12:00:00")
Expected Results:
MsgBox appears at exact time give in TimeValue
Example in documentation needs to be changed to:
- Dim vTimeschedule As Long
+ Dim vTimeschedule As Double
Reproducible: Always
User Profile Reset: No
Additional Info:
See also question:
https://ask.libreoffice.org/en/question/291019/macro-show-msgbox-at-specific-time-of-the-day/
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20210203/563f28f4/attachment.htm>
More information about the Libreoffice-bugs
mailing list