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: [email protected]
          Reporter: [email protected]
                CC: [email protected]

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.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to