Click here to Skip to main content
15,887,886 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Need help with poker hands codes Pin
Dave Kreskowiak14-Jul-14 18:23
mveDave Kreskowiak14-Jul-14 18:23 
QuestionRemove image from first column in ListView Pin
jkirkerx13-Jul-14 12:41
professionaljkirkerx13-Jul-14 12:41 
AnswerRe: Remove image from first column in ListView Pin
Eddy Vluggen14-Jul-14 0:32
professionalEddy Vluggen14-Jul-14 0:32 
GeneralRe: Remove image from first column in ListView Pin
jkirkerx14-Jul-14 6:38
professionaljkirkerx14-Jul-14 6:38 
GeneralRe: Remove image from first column in ListView Pin
Eddy Vluggen14-Jul-14 7:43
professionalEddy Vluggen14-Jul-14 7:43 
Questionhow to Add Combo-box in DataGrid View to Select My Product Pin
D-Matrix's Systemware13-Jul-14 6:59
professionalD-Matrix's Systemware13-Jul-14 6:59 
AnswerRe: how to Add Combo-box in DataGrid View to Select My Product Pin
Richard MacCutchan13-Jul-14 7:31
mveRichard MacCutchan13-Jul-14 7:31 
QuestionList of List returning only copies of last list added Pin
BubbaBeans8-Jul-14 13:05
BubbaBeans8-Jul-14 13:05 
I am attempting to create a list of lists so I can return a specific list when I reference list(index), for example. I created a custom class and am using it as the list type.

A subroutine reads through a text file (csv) one line at a time. The value in the line indicates the "section number" to which the rest of the line belongs, and all other values on that line are used to set certain properties in my custom class. (Confusing?)

Basically it reads through the lines, and if the first number is the same as the first number in the previous line, it processes the line and adds it to a list. If the number is different, it adds the list to the main list, then clears the list, and adds the current line to the new list.

And repeat until the end of the file.

Here is the code:
Dim EvalTopics As new List(of List(of customClass))
Dim sr As StreamReader = New StreamReader(BLAHBLAHBLAH)
        Dim OldSec As Integer = 0, NewSec As Integer = 0 'Old and New Section Numbers
        Dim seclist As New List(Of customClass) 'List to be added to EvalTopics
        While Not sr.EndOfStream
            Dim splits() As String = sr.Readline.Split(",")
            NewSec = splits(0) 'Section # is first value
                If OldSec <> NewSec Then
                    EvalTopics.Add(seclist)
                    seclist.Clear()
                    OldSec = NewSec
                End If
                Dim es As customClass = New customClass
                With es
                    'assign the other values to various properties
                End With
                seclist.Add(es)
        End While
        EvalTopics.Add(seclist)'Add the last section
        sr.Close()


After populating the lists, if I call up EvalTopics(0), I get the same as EvalTopics(3). In fact, every list I call up is the same as the LAST LIST ADDED.

Can someone point me in the right direction? At first I thought I was using lists incorrectly, so I tried an array of lists, then a list of arrays. Nothing worked.
AnswerRe: List of List returning only copies of last list added Pin
Estys9-Jul-14 0:34
Estys9-Jul-14 0:34 
GeneralRe: List of List returning only copies of last list added Pin
BubbaBeans9-Jul-14 6:29
BubbaBeans9-Jul-14 6:29 
AnswerRe: List of List returning only copies of last list added Pin
Dave Kreskowiak9-Jul-14 2:36
mveDave Kreskowiak9-Jul-14 2:36 
QuestionVB.net debug question Pin
James Carlo Valdeavilla8-Jul-14 4:40
James Carlo Valdeavilla8-Jul-14 4:40 
AnswerRe: VB.net debug question Pin
Dave Kreskowiak8-Jul-14 14:33
mveDave Kreskowiak8-Jul-14 14:33 
AnswerRe: VB.net debug question Pin
Richard MacCutchan8-Jul-14 23:23
mveRichard MacCutchan8-Jul-14 23:23 
GeneralRe: VB.net debug question Pin
James Carlo Valdeavilla9-Jul-14 12:51
James Carlo Valdeavilla9-Jul-14 12:51 
GeneralRe: VB.net debug question Pin
Bernhard Hiller9-Jul-14 21:04
Bernhard Hiller9-Jul-14 21:04 
QuestionSaving image into ms access database Pin
Member 109246424-Jul-14 4:03
Member 109246424-Jul-14 4:03 
AnswerRe: Saving image into ms access database Pin
CHill604-Jul-14 5:39
mveCHill604-Jul-14 5:39 
AnswerRe: Saving image into ms access database Pin
Richard MacCutchan4-Jul-14 5:56
mveRichard MacCutchan4-Jul-14 5:56 
AnswerRe: Saving image into ms access database Pin
Chris Quinn7-Jul-14 22:58
Chris Quinn7-Jul-14 22:58 
QuestionCustom Installation Pin
STSanford3-Jul-14 5:18
STSanford3-Jul-14 5:18 
AnswerRe: Custom Installation Pin
Richard MacCutchan3-Jul-14 5:21
mveRichard MacCutchan3-Jul-14 5:21 
GeneralRe: Custom Installation Pin
STSanford3-Jul-14 5:24
STSanford3-Jul-14 5:24 
GeneralRe: Custom Installation Pin
Richard MacCutchan3-Jul-14 5:37
mveRichard MacCutchan3-Jul-14 5:37 
GeneralRe: Custom Installation Pin
STSanford3-Jul-14 5:42
STSanford3-Jul-14 5:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.