From fbbe842a185a2473b15fcd0675a83aa343084108 Mon Sep 17 00:00:00 2001 From: LibreOļ¬ƒciant Date: Wed, 23 Oct 2019 19:18:29 +0200 Subject: UBound/LBound functions return a 'Long', help says 'Integer' Verified on Windows, GNU/Linux and MAC OS: Typename(Ubound(array)) and Typename(Lbound(array)) equal "Long" Inherited from aOO Change-Id: I389c2d70c10e374ffe674dd8ef40d787d55389cd Reviewed-on: https://gerrit.libreoffice.org/81416 Tested-by: Jenkins Reviewed-by: Olivier Hallot --- source/text/sbasic/shared/03102900.xhp | 25 ++++++++++++------------- source/text/sbasic/shared/03103000.xhp | 27 +++++++++++++-------------- 2 files changed, 25 insertions(+), 27 deletions(-) (limited to 'source/text') diff --git a/source/text/sbasic/shared/03102900.xhp b/source/text/sbasic/shared/03102900.xhp index f7c4f41d5e..e237b38007 100644 --- a/source/text/sbasic/shared/03102900.xhp +++ b/source/text/sbasic/shared/03102900.xhp @@ -44,7 +44,7 @@ Return value: -Integer +Long Parameters: ArrayName: Name of the array for which you want to return the upper (Ubound) or the lower (LBound) boundary of the array dimension. @@ -55,19 +55,18 @@ Example: -Sub ExampleUboundLbound -Dim sVar(10 To 20) As String - Print LBound(sVar()) - Print UBound(sVar()) -End Sub +Sub VectorBounds + Dim v(10 To 20) As String + Print LBound(v()) ' returns 10 + Print UBound(v) ' returns 20 +End Sub ' VectorBounds -Sub ExampleUboundLbound2 -Dim sVar(10 To 20,5 To 70) As String - Print LBound(sVar()) ' Returns 10 - Print UBound(sVar()) ' Returns 20 - Print LBound(sVar(),2) ' Returns 5 - Print UBound(sVar(),2) ' Returns 70 -End Sub +Sub TableBounds + Dim t(10 To 20,-5 To 70) As Currency + Print LBound(t), UBound(t()) ' returns 10 20 + Print LBound(t(),2) ' returns - 5 + Print UBound(t,2) ' returns 70 +End Sub ' TableBounds diff --git a/source/text/sbasic/shared/03103000.xhp b/source/text/sbasic/shared/03103000.xhp index abd8ff54d1..a997d5558e 100644 --- a/source/text/sbasic/shared/03103000.xhp +++ b/source/text/sbasic/shared/03103000.xhp @@ -44,7 +44,7 @@ Return value: -Integer +Long Parameters: ArrayName: Name of the array for which you want to determine the upper (Ubound) or the lower (LBound) boundary. @@ -55,19 +55,18 @@ Example: -Sub ExampleUboundLbound -Dim sVar(10 To 20) As String - Print LBound(sVar()) - Print UBound(sVar()) -End Sub - -Sub ExampleUboundLbound2 -Dim sVar(10 To 20,5 To 70) As String - Print LBound(sVar()) ' Returns 10 - Print UBound(sVar()) ' Returns 20 - Print LBound(sVar(),2) ' Returns 5 - Print UBound(sVar(),2) ' Returns 70 -End Sub +Sub VectorBounds + Dim v(10 To 20) As String + Print LBound(v()) ' returns 10 + Print UBound(v) ' returns 20 +End Sub ' VectorBounds + +Sub TableBounds + Dim t(10 To 20,-5 To 70) As Currency + Print LBound(t), UBound(t()) ' returns 10 20 + Print LBound(t(),2) ' returns - 5 + Print UBound(t,2) ' returns 70 +End Sub ' TableBounds -- cgit