Bug Hunting Session
Bug 85443 - Problem returning arrays
Summary: Problem returning arrays
Status: RESOLVED WONTFIX
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
4.3.2.2 release
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-25 14:49 UTC by TopHound
Modified: 2015-11-18 08:48 UTC (History)
2 users (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 TopHound 2014-10-25 14:49:22 UTC
Sample code:

Private mTitleArray() As String

Public Property Get TitleArray() As String()
    TitleArray = mTitleArray
End Property

This works in VBA but BASIC objects to the "as String()", but "as variant" is accepted.
Comment 1 Nicholas Niro 2015-11-18 08:42:40 UTC
Unfortunately, not all features in VBA could be ported to basic. Currently, the only way you can implement this kind of coding style is by converting it to basic's syntax. 

Also, I wasn't able to make this part of your code work : "Public Property Get"

here's a suggestion on how to implement what you need : 

private testTitleArray() AS String

Public Function getTitleArray() AS Array
	 getTitleArray = testTitleArray
End Function

Sub Main
	Dim testArray(2) AS String
	
	testArray(0) = "herein"
	testArray(1) = "foo"
	testArray(2) = "bar"


	testTitleArray = testArray
	msgBox getTitleArray()(1)
End Sub