I am having a little trouble trying to use an array list. I am using a function that I want to return the array list. However, I am having a problem getting it to return the arraylist. when i do this:
I want the Function to accept List(Of String), Array & String and similarly return List(Of String), Array & String respectively. The Function simply adds a string (month) to the input collection. I just want to use it for string, array and list with needing to think of conversions.
I'm working on a program dealing with jagged arrays.Code is below.The FindPath() function works perfectly.It essentially randomly chooses an action from 3 possible choices.The goal of this function is to make it to position (3,3) from (0,0).Sometimes it makes it, sometimes it doesn't.It gives up after 2000 moves.
The PushButton() function is where I have the problem.I want to run the FindPath() function 2000 times, and return the resulting list of moves into intLists()(), my jagged array.I want to use
intRuns = 0 For intRuns = 0 To intLists.GetUpperBound(0) lstMoveList.Items.Add(intLists(intRuns).GetUpperBound(0)) 'here is where I get the problem.
this section of code to dump the number of attempts it took into a listbox on the main window.I do this at the bottom of the FindPath() function, but that is for testing purposes only.I eventually want to take the successful attempts and manipulate those, so eventually I get the minimum possible number of movements to get from the starting point of (0,0) to the ending point of (3,3).
Function PushButton() Dim intRuns As Integer Dim intLists(2000)() As Integer[code]...............
I have a program that will compare an array of grocery list items glist and an array of coupon item clist.When I compare the two and if there is a match somewhere in the array I want to have a picturebox visible.When there is no match, I want the picture box not to be visible. [code] The code seems to work great until I come to the else statement.When the code finds a match it displays the picture box and the msgbox without error, but as soon as the message box is cleared, even though i've input it as an ELSE statement, the picturebox goes false again.Does anyone have any idea of how I can "hold" the picturebox to stay visible while the match between the arrays exists?
That was probably bad title, but I'll illustrate what I'm trying to do. I have a method in a class that I need to call several times. The method returns a List(Of String). I'm just grabbing some information from a database.
VB.NET Public Function GetTestList() As List(Of String) Dim int As Integer = 0
Row3 ;W910 RF350022 ;Increase backlight by 100% ;(c) spring ;(p) spaceman +1000000 F5 000000 5555 44 555555 904938291 8676859 00
Row4 (Duplicate of Row3) ;W910 RF350022 ;Increase backlight by 100% ;(c) spring ;(p) spaceman +1000000 F5 000000 5555 44 555555 904938291 8676859 00
if label1 = RF350022 label2 = Increase label3 = spring label4 = 100%
only if it contains all of these words it should return the first instance (row3) then end or null the rest (row4).how can i get row 3 to show in message box now it has been found?
After reading all the examples for list of T exists and Find and find first, none show how to handle multi-property objects. Below is bare bones example maybe someone could flesh out to show how this should be done.
Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim DatePriceList As New List(Of DateAndPrice) DatePriceList.Add(New DateAndPrice(Date.Parse("1/1/2000"), 10.12)) DatePriceList.Add(New DateAndPrice(Date.Parse("1/2/2000"), 11.12))
I would like to have a function(of T) that returns a list(of T) that is assignable to a variable of list(of T).For Example:
the variable: Private _StandardCodes As List(Of StandardCode) the assignment:[code]....
I'm getting the error "Type paramater 'T' for ... cannot be inferred", as a result I have to use a comparable function to return a list(of Object) and then do:
_StandardCodes = (From x In AMExtensions.queryObject(GetType(StandardCode), "StandardCode") _ Select CType(x, StandardCode)).ToList
i have issue returning a list in a web method. here is the code
<WebMethod()> _ Public Function getTags(para_parents As String) As List(Of getTypeDetailsByParentName_Result)() Dim context As New PPEntities
[code]....
the error is
Value of type 'System.Collections.Generic.List(Of SaftyonRoad.getTypeDetailsByParentName_Result)' cannot be converted to '1-dimensional array of System.Collections.Generic.List(Of SaftyonRoad.getTypeDetailsByParentName_Result)'
I am trying to get a count of all the times a byte sequences occurs in another byte sequences. It cannot however re-use a bytes if it already counted them. For example given the string let's assume the byte sequence was k.k it would then find only 3 occurrences rather than 5 because they would be broke down like: [k.k].[k.k].[k.k]. and not like [k.[k].[k].[k].[k].k] where they over lap and essentially just shift 2 to the right.
Ideally the idea is to get an idea how a compression dictionary or run time encoding might look. so the goal would be to get down to just 2 parts, as (k.k.k.) is the biggest and best symbol you can have.
Before adding rows to a table I am evaluating the SSN number. These will later be flagged for correction so I am setting a datatable column to true or false if it passed muster or not.
I wrote a function to check the number and make the determination plus pad it with zeros and hyphens where they should be. My problem is I want to return the results in an array. I am getting system.string[] as the return value.[code]...
I want to return an array from a function.dt is a DataTable that is global
HTML Dim dr As DataRow For x As Integer = 0 To adoc.GetUpperBound(0) dr = ds.Tables(0).NewRow()
[code].....
I'm definitely missing something here. I am trying to return an array forn the sql statement, chich I can reference as abom() in the original source.The ultuimate goal is to manually populate dt.
I have got an array being populated which works fine What i want it to do is to return one of the items in the array (within a text box for example) which corrects certain criteria.
This is a school project, supposed to be a beggining VB.Net class. I'm having difficulty with one section, sorting the array is OK but I need to only return a 3 of it. I had it working when I was selecting single files but when I went to selecting multiple files at once the formula stopped working for me. I'm retuning the array just fine but the select a 3rd seems to just pass by without being acted upon. I've been working on this a long time and don't know where to look for an answer. Here is what I have for the sort method;
Private Sub sort() Dim Count As Integer Dim count2 As Integer
I know I can do this with a for loop cause that's how i'm doing it now. I was hoping for a more efficient way to accomplish the task.
I have a dictionary(Of Integer, Boolean) or Of String, Boolean. i want to get a list(of integer) or Of String from the dictionary where all the values are true(or false depending on what i need at the time)
and to generalize it or "black box" it, it could be any dictionary(of whatever, whatever) and return a list(of whatever) where the value = whatever i'm looking for at the time.
string, string where value = "Closed"
in short: i want all list of all the keys who's value = some criteria
my current code:
Public Function FindInDict(Of tx, ty)(thedict As Dictionary(Of tx, ty), criteria As ty) As List(Of tx) Dim tmpList As New List(Of tx)
Friend Class PairCollection(Of TKey, TValue) Inherits List(Of KeyValuePair(Of TKey, TValue)) Public Overloads Sub Add(ByVal key As TKey, ByVal value As TValue) Me.Add(New KeyValuePair(Of TKey, TValue)(key, value)) End Sub
I have a list going into a repeater, sorting with jquery sortable(), and then need to put the sorted list into a session variable. I cannot seem to figure out how to get the sorted values back into a list.[code]...
Update: I didn't make it clear but I meant this to be a question about where/how I would use a function to return a list of strings when I'm trying to just work with classes.I have a class called Account.
I have data access class called AccountDAO.I have various functions that return lists of objects like GetAllAccounts, GetAccountByID etc.I want to populate a drop down list with just the account names and nothing else. It's proving rather slow when using lists of objects and databinding them to the dropdownlist.
I feel like I should be using a simple "Select Account_Name From blah" type statement and returning a list of strings but I don't know how to work this into my class and data access class.
I'm trying to call a function from a sub, and have it return an array to the original sub.
I currently have:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Call Registry_GetUsers() End Sub
[code]....
Which works, but I want to loop through each of the items in users from within the original sub, not the function, as it currently does.So I need to return the array to the original sub, so I can then iterate through it from there.