Solved

Returning an array from a function

Posted on 2004-10-07
2
165 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 125 total points
ID: 12247853
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
JSON Response and request in VB6 application 11 235
MsgBox 2 47
Visual Studio search word table and return Cell index 8 48
Recommendation vb6 to vb.net or others 14 105
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

919 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now