https://bugs.documentfoundation.org/show_bug.cgi?id=161883
Bug ID: 161883
Summary: ElseIf is not equivalent to Else If
Product: LibreOffice
Version: 7.3.7.2 release
Hardware: All
OS: All
Status: UNCONFIRMED
Severity: normal
Priority: medium
Component: Documentation
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
The documentation states
"Instead of Else If you can write ElseIf, ..."
https://help.libreoffice.org/latest/ka/text/sbasic/shared/03090101.html
This seems to be untrue, see the following code where the Function CC1 using
ElseIf works perfectly as expected, while CC is in a mess and should not even
compile, because it as two End If
Copy the code into a module and execute Main
Sub Main
MsgBox CC(0)
MsgBox CC1(0)
End Sub
Function CC(lNumber As Long) As String
Dim s1 As String
If lNumber <= 0 Then
s1 = "lNumber <= 0"
Else If lNumber > 1 Then
s1 = "lNumber > 1"
Else
s1 = "Else"
End If
MsgBox s1
CC = s1
End If
End Function
Function CC1(lNumber As Long) As String
Dim s1 As String
If lNumber <= 0 Then
s1 = "lNumber <= 0"
ElseIf lNumber > 1 Then
s1 = "lNumber > 1"
Else
s1 = "Else"
End If
MsgBox s1
CC1 = s1
End Function
--
You are receiving this mail because:
You are the assignee for the bug.