I should be able to pass an array of numbers, calculate average, lowest number, highest number, and standard deviation.the function returns an array containing the results. I dim public data
Public dataArray() As Double
Public DataIndex As Integer = 4
Private Function CalculateData(ByRef dtArray() As Double) As Double()
[code]....
I get an "error Number of indices is less than the number of dimensions of the indexed array" stats()If I add a dimension there like stats(Dataindex) I get an error "Value of type '1-dimensional array of Double' cannot be converted to 1-dimensional array of double".
My brain may just be fried since it's the end of the semester, but my teacher kicked this back to fix and resubmit...she said that I am "returning the name of your function rather than your variable name".
Here is my code for all 3 forms.
code:
These are forms to calculate the cost of getting a cell phone package.
can i save the returning value of eval function in a variable and use it wherever i want? i can call it just in <asp: .... tags. i can't use them in vb methods. is it possible?
I need to return an array but the array size will change from one call of the function to another so I need away to storing the returned array. The function is as below, and as you can see the returned array will be of different sizes:
Im overiding getRolesForUser() I have 2 columns i return from the query IAdapter.GetRolesByUserName(userName) returns two columns (roleID, formID) How can I return them and access the two columns data? 2 dimensional array?
I'm having trouble finding out how define this function so I can return the arrayRight now I am defining the returnobject as 'object' but I would like to do it properly.The Function goes something like this:
I'm trying to return changes to array data, including redimensioned arrays, from within a function call in code similar to: fault = MyFunction(Array1, Array2) Public Function MyFunction(ByVal inObj1 as UserStruture(), ByVal inObj2 and Integer(,)) as String Dim myResult as String = "Failed" Dim tmpStruct() as UserStructure = inObj1
[Code] .....
This works fine in updating the input array 'Array1', only when the redimensioning of tmpStruct is NOT performed. After redimensioning tmpStruct, the redimensioned array is passed back successfully into 'inObj1' within the function 'MyFunction', but is not passed out of the function call; i.e. fault = MyFunction(Array1, Array2) -
The dimension of array 'Array1' out of the function call remains as it was before the function call. However, the data change; i.e. tmpStruct(0).Nam = "New Name" is passed successfully out of the function call.
Why the Redim operation is not passed back out of such function calls. I would like to return changes to arrays 'Array1' and 'Array2', plus a result string from the function call if I can. Furthermore, I would also like to change the dimension of the array within the function call, if required, and return the complete redimensioned array back out of the function call.
I'm attempting to create a function that will get the User Accounts from the registry. I then need to loop through those users and commit specific actions on each one.Here's my function:
VB .NET ublic Function UserAccounts() As String Dim userskey As RegistryKey = Registry.LocalMachine.OpenSubKey("SOFTWAREMicrosoftWindows
Im having a very difficult time trying to pass an vba array ive built from ms- access vba to a .net function.I don't have a com problem I can reference the library just fine from vba but and i can call a simple function from vba. however my problem exist when i attempt to try to pass an array to the vb.net function. vb.net code
Im having a very difficult time trying to pass an vba array ive built from access vba to a .net function. I dont have a com problem I can reference the library just fine from vba but and i can call a simple function from vba. however my problem exist when i attempt to try to pass an array to the vb.net function. vb.net code
<ComClass(ComClass1.ClassId, ComClass1.InterfaceId, ComClass1.EventsId)> _ Public Class ComClass1 Public otag As String()
I have a structure to hold a student name, an array to hold 5 test scores, and an average score. I have created an a array of structures for 6 students. User input is setup through text boxes. I want to calculate the average for each student. I have made a function to do this. What I am having trouble with is how to pass the array of test scores to the function.
Here is what I have so far:
CODE******** Public Const intMAX_STUDENTS As Integer = 6 Public Const intMAX_NUMTESTS As Integer = 5 Public student(intMAX_STUDENTS - 1) As StudentData
I am trying to code for is as follows: Construct a two dimensional array and enter into it a sales id number followed by twelve variables which represent sales totals made by the sales agent. this must provide space for five agents. I can declare the proper array and have done so as follows
Dim Sales (4,12) As Double. I also crafted a click event which will count from 1-12 (which excludes the sales id number) and disables the sales id number so it cannot get used. [Code]
What I am trying to do is setup a function within the same click event procedure which stores the current SalesAmount as a variable in the array and moves to the next slot to get ready to store the next SalesAmount. However I have no idea where to go from here. I have tried a ton of different pieces of code which are either all littered with errors or do not return a value when I call it. Calling the total of each row and the total for all rows is something I need to do for display and I am not one hundred percent sure I know how to do that either.
I am writing a program with multiple forms (for inputing loan/financial information - so they are set up exactly the same albeit a form number (ie: 1-6)) that feed into a summary page form to display each individuals form's information. When the user closed a financial form, it then feeds the information to a summary page using the code I have below: [Code]. I am new to working with functions, and have not been able to find anything that can show me how to fill multiple textboxes with them (I only know how to return a variable using the function to work a calculation). Any way that I can write a function (or any other call) for this would save me a tremendous amount of coding, and make debugging worlds easier.
This is a quite strange problem. I have set a setting variable in Application settings with following data:
[Code]...
Yet when I reference it with this statement: MsgBox(My.MySettings.Default.county) It alerts 1. Despite being the first to be executed as soon as form loads.
is this safe (I know it works, but is it safe)? Is it returning a reference to a local variable, wich falls out of scope as soon as the function returns?
Public Function myfunc() As String Dim strXml As String
returning a function value? I have a simple function that returns an integer. This function works fine when executed in SQL Developer but, when called from my apps, it always returns 2 regardless of anything. I have checked it over and over again, I cant seems to find where I am going wrong.
what changes I need to make to the code so that when no value for intPosition is found the textbox txtRoomNumber remains blank? At the moment a value is being entered into the textbox when no value for intPosition is found.
Code: Private Sub btnFindRoom_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFindRoom.Click Dim strRoomType As String Dim intRoomNumber As Integer
Public Function Checked() As Boolean Return applyChange 'this is a string! End Function
Whats going on here? How can a function with return type Boolean actually return a string? I'm assuming theres some implicit conversion going on here, which I'd rather not have.
I am hopeing someone can help me here with a recursive function I have that is not returning either true or false as I would have espected it to. The function loops through a Active Directory group for its members and then calls itself if it encounters any groups within the membership in order to gets its members as well. I am trying to return either true or false based on if any errors were encountered but not haveing any luck at all. It appears to just hang and never return back to the primary calling sub that starts the recursive function. Below is my code I am using:
If an object is created inside a function and the function returns that type of oject how is the memory handled.
Example:
Public Function GetEmployee(employeeid as integer) as employee Dim oEmployee as new employee oEmployee.FirstName="Bob"
[code]....
Does the variable that receive the object still a pointer to the memory location that was used inside the function?What about when you do a oEmployee2=oEmployee.Is oEmployee2 just a pointer? And any changes to oEmployee will now affect the other. Just trying to understand it from a memory perspective and how that scope works?
I have stored procedure which I will execute its result and pass it into a Dataset and return it but at the same time I have a Output parameter in my stored procedure which I also want to return, how can I return both the dataset and the integer output value with my function, or is there a more 'appropriate way' to handle such situation?[code]
Is it possible to return more than one value from a function? Like two integers, or an integer and a boolean, or any other data type combination. I understand I could use a sub and set these values in a variable but I was wondering if I could avoid declaring more variables by using a function.
I've got this MustInherit class called ViewerElement, from which derive classes like ViewerLine, ViewerImage, etc.Then, in the main program I have a collection of different elements (Images, Lines, etc.). What I want to do is something like the following:
[Code]...
I'm getting desperate to implement this Clone method without getting errors. How should this be de done?
Ok simply my code doesnt want to output the correct number. I'm working on the project euler probems to expand my knowledge in VB.net and the current question I am working on is asking to work with triangle numbers. while researching I found that a triangle number can be calculated by using the formula:
i being ordered to change my function skill to returning value by using struct but not using pointer. may i know what is the pro and con between this 2?