Bug 162470 - BASIC Else diagram (Else_fragment.svg) wrongly mentions a condition
Summary: BASIC Else diagram (Else_fragment.svg) wrongly mentions a condition
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Documentation (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Alain Romedenne
URL:
Whiteboard: target:25.2.0
Keywords:
Depends on:
Blocks: Help
  Show dependency treegraph
 
Reported: 2024-08-14 16:23 UTC by fpy
Modified: 2024-08-27 19:29 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description fpy 2024-08-14 16:23:35 UTC
From https://help.libreoffice.org/25.2/en-US/text/sbasic/shared/03090101.html
(where the Syntax paragraph is correct)

see 
https://help.libreoffice.org/25.2/media/helpimg/sbasic/Else_fragment.svg

Expected : no "condition -- then -- "


Note: referring to 25.2 to get latest changes, but already there in "latest".
Comment 1 fpy 2024-08-14 16:31:35 UTC
Note: the example given on the page is not the brightest, comparing days first  :/
Comment 2 Alain Romedenne 2024-08-15 08:08:05 UTC
Thanks for your report

Indeed, many examples are 14 years old. What do you suggest? There could be 2 to 3 different examples
Comment 3 fpy 2024-08-15 08:41:03 UTC
(In reply to Alain Romedenne from comment #2)
> suggest? 

To keep the existing, just use Date consistently (see also tdf#131332)
>>>
    Dim sInput As String
    Dim dInput As Date

    sInput = InputBox("Enter the expiration date (YYYY-MM-DD)")
    dInput = DateValue(sInput)

    If dInput < Date() Then
        MsgBox "The expiration date has passed"
    ElseIf dInput > Date()  Then
        MsgBox "The expiration date has not yet passed"
    Else
        MsgBox "The expiration date is today"
    End If
<<<


and to examplify a shortened too, maybe :

>>>
    Dim sInput As String
    Dim dInput As Date

  On error goto inputError
    sInput = InputBox("Enter the expiration date (YYYY-MM-DD)")
    dInput = DateValue(sInput)

    If dInput < Date() Then
        MsgBox "The expiration date has passed"
    ElseIf dInput > Date()  Then
        MsgBox "The expiration date has not yet passed"
    Else
        MsgBox "The expiration date is today"
    End If
    
inputError:
	If dInput = 0 Then MsgBox "Invalid input"
<<<
Comment 4 Commit Notification 2024-08-22 14:57:45 UTC
Alain Romedenne committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/help/commit/2fed269e1f9315e50e277c54ffc1053d48385ca9

tdf#162470 Fix to If statement syntax diagram