Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Returning an array from a function

Posted on 2004-10-07
2
Medium Priority
?
173 Views
Last Modified: 2010-05-02
i have made a function that reads a *.dc6 file, palettizes it, renders in a picturebox and stores it in an array of IPictureDisp's. now theres 2 changes that needs to be made:
1: the array must be a Type ive made myself
2: the array must be returned from the function, like Split(). so i can say MyPics() = DC6Handler.LoadDC6("c:\myimage.dc6", "c:\mypalette.dat")

is this possible somehow? as in, DC6Handler (my functions + all thats needed) is a usercontrol that allows the user to Import, and soon also Export DC6 files. the import shall return an array while the Export shall take the same type of array as a parameter
0
Comment
Question by:Tai-San
  • 2
2 Comments
 
LVL 53

Expert Comment

by:Dhaest
ID: 12247840
Dim YourArray(10) As Byte

' Pass by reference.
Function ModifyBytes(ByRef YourArray() As Byte)

' Modify data in array here

'To return one value, add 'as bytes' after function header

' Add 'ModifyBytes = YourArray(2) inside your function
End Function

I hope this can help you. ^^
0
 
LVL 53

Accepted Solution

by:
Dhaest earned 500 total points
ID: 12247853
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

876 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question