VB HELP!!!!!!!!!

.net , databases Ireland
  • 19 years ago

    Hope that you can help!


    If you have the time here is the scenario


    I have a text file with a list of numbers in one column, say
    5
    1
    1
    1
    2
    1
    2
    1
    and so on, what i require is a count in VB that will read in the values above and and then up, so that it gives the overall result as  14.


    Think you can help?


    Thanking you!

  • 19 years ago

    dim strBuffer as string
    dim lngTotal as long


    open [Filename] for input as #1


    do until EOF(1)
      line input #1, strBuffer
      lngtotal = lngtotal + clng(strbuffer)
    loop


    debug.print lngtotal

  • 19 years ago

    Darryl,
    Thanks a million,
    am not sure what you mean by download .NET
    Can you please explain and forgive my stupidity!!!!!


    said:

    Quote:
    dim strBuffer as string
    dim lngTotal as long


    open [Filename] for input as #1


    do until EOF(1)
      line input #1, strBuffer
      lngtotal = lngtotal + clng(strbuffer)
    loop


    debug.print lngtotal


  • 19 years ago

    That's just my signature on my account here at Developer Fusion.  


    .NET is the new Microsoft development platform that's in Beta right now.  


    it's full name is Visual Studio.NET
    Basically it's the new version 7 of all the main Microsoft development tools.


    Eg.
    Visual Basic.NET (version 7)
    ADO.NET
    Visual C++.NET (version 7)
    Visual C#.NET (version 7) ... This is actually a newer languge that is being introduced in the .NET platform
    etc.  There's a couple more languages and technologies that are being introduced too ... but you get the picture.


    hope that explains it.

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“In order to understand recursion, one must first understand recursion.”