how do you print from a sequential access file

i'm stupid and can really use some help. i'm distance learning vb 6.0 programming and i'm completely stuck. what are the proper commands or syntax for getting a sequential access file to read the file, accumulate the total prices, give an average price for the total quantity and print that file. i'm sick and tired of trying to go this on my own and if anyone could please help it would be greatly appreciated. I've tried everything the book suggests and all i get is a bunch of garbled stuff without the file, totals or averages.

Comments

  • : i'm stupid and can really use some help. i'm distance learning vb 6.0 programming and i'm completely stuck. what are the proper commands or syntax for getting a sequential access file to read the file, accumulate the total prices, give an average price for the total quantity and print that file. i'm sick and tired of trying to go this on my own and if anyone could please help it would be greatly appreciated. I've tried everything the book suggests and all i get is a bunch of garbled stuff without the file, totals or averages.
    :


    Here is a little help for you.

    [code]
    somefile = App.Path + "somelist.txt"
    Open "somelistt.txt" For Input As #1

    picResults.Print "result text"; someVar; "are"


    For intFirst = 1 To intDay
    Input #1, var1, var2
    curSum = (curSum + (intFirst * var2))
    picResults.Print intFirst; var1
    Next intFirst
    Close #1
    picResults.Print "Cost: "; FormatCurrency(curSum)
    picResults.Print
    curSum = 0

    For intFirst = 1 To 12
    Open "someText.txt" For Input As #2
    For intSecond = 1 To intFirst
    Input #2, var1, var2
    curSum = (curSum + (intSecond * var2))
    Next intSecond
    Close #2
    Next intFirst
    Close #2
    picResults.Print "some text goes here: "; _
    FormatCurrency(curSum)
    [/code]

    anyway that should get you started.

    Tazzy
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion