Expected Results: A scalar result of the comparison between Array1 and Array2 such that when Array1>Array2 it is true. See expected array above. Actual Results: When Result(x) is true, all elements become Array1(x) and Array2(x) .What is wrong with the function?
I want my function to return a value of a structure. The function is supposed to change the values and then return the answers in one structured value. Here is my code... as you can see it does not work... it needs a LOT of things. I placed question marks were i am really lost.
I am trying to do a simple program where I have a public structure and public function in a code file, the problem is I want to return two integers. Here is the code from my code file.
I have a windows app that references a web service I created. In the web service, I created a function that needed to return more than one value. Because of this, I created a public structure in the web service: Public Structure MyRecordSet Public lstOfDataInRecord As List(Of String) Public iNumberOfRecords As Integer End Structure
Here's the function - the return value is MyNewRecordSet: Dim MyNewRecordSet As MyRecordSet <WebMethod()> _ Public Function GetDataReturnList(ByVal sql As String, ByVal sTableName As String) As MyRecordSet MyNewRecordSet.lstOfDataInRecord = New List(Of String) [Code] ..... Anyway, I see it's a conversion issue, but not sure how to resolve it. This is my first attempt to use a public structure in a web service and receive a return on it from my app.
I have created a small subroutine that resizes controls which don't have an autosize. The idea is to use the scrollbars to see if the content fits into the control. Whenever I want to autosize the hight of the control I call the getScrollInfo with SIF_POS.
Making the control "higher":
If nPos is then > 0
I add some pixels to the size.heigt of the control until nPos is =0
This is working fine.... One small problem: When I "switch" of the scrollbar for that control after I reached the right size and then switch it on as soon as I get into my routine again... my routine doesn't work anymore. [Code]
I am trying to return a structure from a class.vb file to an aspx page. Is this possible, if so how would you do it in the aspx page and the class.vb file?
I've created a log in system using a database and query builder to return the correct values, however, once the users signed in I need to bring up the rest of their data from the same table in the database. How'd be the best way of going about this? I'm not sure whether the log in should be changed to use the primary key as well.
Just so it's known, this question is mostly academic, even though I tried to use the concept in a real-world solution. I realize the example is contrived, but I believe the concept is valid.I want to write some fluent code like this:
[code]...
I realize that I can't force an anonymous type into a specific type (like implementing an interface or some other class), and I don't want the overhead of defining a specific class just to match my desired fluent name with the actual method name. So I was able to make the code work like this:
copy(my_first_file).to.Invoke(my_second_file)So there is no IntelliSense or type awareness there, and I have to include the Invoke in order to have the method run. How can I get more type safety and exclude the Invoke method, under these constraints: Anonymous Type returned from Method No additional classes or interfaces Preferably, I do not want to pass in another parameter to the copy() method that tells what type to return, unless copy becomes a generic method (but I think that means defining another class/interface, which I don't want to do)
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 am working a VB project that requires me to create an "Average" Function. What is the correct format in creating an average function? I tried different ways and gives me an error.
I have a function that checks for wich dice have been rolled and scores them up in the correct boxes, now i want to be able to check the combined scores to see if they equal upto a full house. [code] and then listing every other possible combination, would there be a simpler way of doing it?
I have declared this function and trying to get the correct coding to call this function correctly.Public Declare Function ColorRGBToHLS Lib"shlwapi. dll" (ByVal clrRGB As Long, pwHue As Long, pwLuminance As Long, pwSaturation As Long) As Long
I have problem about how I call a function on DLL to get data from a structure. Have a C++ example about how it's works the library, and I want to use it on vb.net. his is the working c++ example:
I am attempting to create a generic function that the students in my introductory VB .NET course can use to search a single dimension array of a structure.[code]...
My question is: Is there a way to reference the individual structure fields in the array from inside the function? I was trying to make it generic so that the student could simply pass their array into the function - their structure may be named differently than mine and the field names may be different.
I suspect there are other ways to deal with this situation, but I was trying to keep it to just a simple single-dimension array of a structure. I don't think it is possible to do what I want, but I wondered what others thought.
I have a question: How can I make a function or sub run inside a structure when a variable in this structure changes? As example I have this function: Public Structure Texture Sub New(ByVal TexturePath As String) Me.Path = TexturePath Me.Image = LoadImage(TexturePath) End Sub Public Path As String Public Image As Image End Structure
And somewhere this happens: Dim t As New Texture("path ooldfilename.tga") t.Path = "path o ewfilename.tga" I want it to automatically load the image when the "Path" variable changes. Is the only solution making an extra sub and run that? It would really decrease my code size if it changes on variable change.
I'm a beginner when it comes to Visual Basic coding and I need some help with an error I'm getting. I'm trying to pass a structure array to a function to figure out a student's grade. I'm getting the error that 'QuizOne' is not a member of System.Array. Here is my code:
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
Possible Duplicate: VB.NET Function Return If I have a function that returns a boolean, what is the difference between:Return False and Function = False
how return four value from a function. In general function will return single value but here i am going to return four different values. If possible please tell me how to store the function return values.
I've created my own version of HexToDec() to properly handle the negative flag. I saw other versions online that used "Not(value)" to do the Pos/Neg inversion, but that does not generate the proper value... No, it's not the most elegant my any means. But I couldn't find anything online that actually worked.
Long story short, I want to return NaN in the case that the function is passed a string that is not a valid hex string...
How do I do that? Everything I've tried generates a compiler error... (assign return value to double.nan, assign return value to non-numeric, etc)
Existing function is below:
Function HexToDec(ByVal hexStr As String, Optional ByVal signed As Boolean = False) As Long Dim lngFinal As Long