Solved

Returning an array from a function

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…

707 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

13 Experts available now in Live!

Get 1:1 Help Now