Click here to Skip to main content
15,881,757 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Weird TABCTL32 Error Pin
Member 811728125-May-12 8:32
Member 811728125-May-12 8:32 
AnswerRe: Weird TABCTL32 Error Pin
dg6yhw1129-May-12 6:59
dg6yhw1129-May-12 6:59 
QuestionConversion from string "Label23" to type 'Double' is not valid. Pin
kang-king-kung24-May-12 16:06
kang-king-kung24-May-12 16:06 
AnswerRe: Conversion from string "Label23" to type 'Double' is not valid. Pin
Luc Pattyn24-May-12 17:03
sitebuilderLuc Pattyn24-May-12 17:03 
AnswerRe: Conversion from string "Label23" to type 'Double' is not valid. Pin
Ron Beyer24-May-12 17:06
professionalRon Beyer24-May-12 17:06 
AnswerRe: Conversion from string "Label23" to type 'Double' is not valid. Pin
Luc Pattyn25-May-12 4:10
sitebuilderLuc Pattyn25-May-12 4:10 
QuestionPrinting in vb.net Pin
maildummy23-May-12 21:07
maildummy23-May-12 21:07 
QuestionReading the contents of a file into an array Pin
GeorgieMPorgie23-May-12 6:19
GeorgieMPorgie23-May-12 6:19 
I'm trying to read the contents of a file into an array, but for some reason the values are showing up in the array as nothing? The contents of the file look like this (the file length is about 5,690 lines long)

VB
AA.CSV
AAAGY.CSV
AABC.CSV
AACB.CSV


This is the section of code I have written to attempt to do this

VB
'Read the stock symbols to be copied to a new folder into an array

        Dim stocksymbolarrayLong(25000) As String
        Dim filecount As Integer
        Dim counter As Integer

        'Count the lines in the file you are reviewing.

        Dim LongFile As System.IO.StreamReader
        LongFile = System.IO.File.OpenText("C:\Users\George Desktop\Documents\Stock System\Stock Programs\Stock Program Data\LongStockTesting.txt")

        filecount = 0

        Do Until LongFile.Peek = -1
            LongFile.ReadLine()
            filecount = filecount + 1
        Loop

        For counter = 0 To (filecount - 1)
            stocksymbolarrayLong(counter) = Val(LongFile.ReadLine)
        Next

        LongFile.Close()

        ReDim Preserve stocksymbolarrayLong(filecount - 1)

        ' Sort the array's

        Array.Sort(stocksymbolarrayLong)


This should be very simple to do and solve, but i've been looking at it for a couple hours and don't know what I'm doing wrong?

Can someone help?
George

AnswerRe: Reading the contents of a file into an array Pin
Luc Pattyn23-May-12 6:40
sitebuilderLuc Pattyn23-May-12 6:40 
GeneralRe: Reading the contents of a file into an array Pin
GeorgieMPorgie23-May-12 6:55
GeorgieMPorgie23-May-12 6:55 
AnswerRe: Reading the contents of a file into an array Pin
Eddy Vluggen23-May-12 10:34
professionalEddy Vluggen23-May-12 10:34 
GeneralRe: Reading the contents of a file into an array Pin
GeorgieMPorgie23-May-12 15:55
GeorgieMPorgie23-May-12 15:55 
GeneralRe: Reading the contents of a file into an array Pin
Eddy Vluggen24-May-12 0:22
professionalEddy Vluggen24-May-12 0:22 
GeneralRe: Reading the contents of a file into an array Pin
proneal24-May-12 11:02
proneal24-May-12 11:02 
AnswerRe: Reading the contents of a file into an array Pin
Luc Pattyn24-May-12 11:53
sitebuilderLuc Pattyn24-May-12 11:53 
GeneralRe: Reading the contents of a file into an array Pin
proneal24-May-12 11:56
proneal24-May-12 11:56 
GeneralRe: Reading the contents of a file into an array Pin
proneal24-May-12 11:58
proneal24-May-12 11:58 
GeneralRe: Reading the contents of a file into an array Pin
Luc Pattyn24-May-12 12:08
sitebuilderLuc Pattyn24-May-12 12:08 
AnswerRe: Reading the contents of a file into an array Pin
Dave Kreskowiak23-May-12 7:20
mveDave Kreskowiak23-May-12 7:20 
GeneralRe: Reading the contents of a file into an array Pin
GeorgieMPorgie23-May-12 7:49
GeorgieMPorgie23-May-12 7:49 
AnswerRe: Reading the contents of a file into an array Pin
Luc Pattyn23-May-12 13:56
sitebuilderLuc Pattyn23-May-12 13:56 
GeneralRe: Reading the contents of a file into an array Pin
GeorgieMPorgie23-May-12 15:48
GeorgieMPorgie23-May-12 15:48 
AnswerRe: Reading the contents of a file into an array Pin
frostcox25-May-12 10:37
frostcox25-May-12 10:37 
GeneralRe: Reading the contents of a file into an array Pin
GeorgieMPorgie25-May-12 16:27
GeorgieMPorgie25-May-12 16:27 
QuestionVB Remoting - How do you get the server to pass value to client? Pin
Cutha22-May-12 19:57
Cutha22-May-12 19:57 

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.