Solved

Returning an array from a function

Posted on 2004-10-07
2
167 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

830 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