|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Read sequential file using VBI have a number field in a sequential file. Im going to read this file,
sum up this number and display the grand total in my application using VB. Do anyone know how to do that?? Thanks in advance! Leesa,
>I have a number field in a sequential file. Im going to read this file, This is so basic programming.> sum up this number and display the grand total in my application using > VB. Do anyone know how to do that?? > Try to get a book about programming it does not matter how old it is. Than get VBExpress What you have to do is open a windowsform project Drag from the toolbox a label on the form that is created Click on that form Search for MSDN.microsoft.com for "streamreader" Follow one of the samples on that page I hope this helps, Cor "leesa" <angk***@gmail.com> wrote in message Dim fileReader As System.IO.StreamReadernews:1144208387.621836.56240@v46g2000cwv.googlegroups.com... >I have a number field in a sequential file. Im going to read this file, > sum up this number and display the grand total in my application using > VB. Do anyone know how to do that?? fileReader = My.Computer.FileSystem.OpenTextFileReader ("C:\File.txt") Dim myData As String Do myData = fileReader.ReadLine() Loop While Not fileReader.EndOfStream Homer,
If you write it so exact, would you not count in the routine. Something as > Dim fileReader As System.IO.StreamReader label1.text = ""> fileReader = My.Computer.FileSystem.OpenTextFileReader ("C:\File.txt") > Dim myData As String > Do Label1.text = CDbl(Label1.Text) + CDbl(myData.Substring(0,6))> myData = fileReader.ReadLine() 'to count the first 6 characters > Loop While Not fileReader.EndOfStream Cor> :-)) "Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message Sure. I have a bunch of code in there for my purpose but the OP needs to add news:uKw8AiHWGHA.128@TK2MSFTNGP05.phx.gbl... > If you write it so exact, would you not count in the routine. > > Something as .... his summing code. hi Cor and Homer,
Thanks for ur explanation and code example ya. Very grateful to get feedback from u guys. thanks!
Seemingly random Concurrency violations updating Access database
Create controls at runtime RE: Which software do I need to program VisualBasic ? How to invoke the ClassLibrary? really strange error Re: String.Trim Interpret HTML <Script> in Visual Basic MDI Child Controls question Host application in IE New : test yourself my new VB6 syntax analyzer. |
|||||||||||||||||||||||