Results 1 to 4 of 4

Thread: re Aaron

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 1999
    Location
    Calgary,Alberta, Canada
    Posts
    70

    Post

    Question when i had the dtemp*1.07"currency" calculation in my line of code and used the cmdadd amd cmddelete sometimes it would end up with a 1 cent in the total textbox sometimes what makes it more accurate delcareing in in a variable the code looks
    the same and why are you up so late

  2. #2
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,177

    Post

    Because you are formating the result as Currency you are cutting off some trailing decimal places, so when you recalculate using the Value of the Textbox you no longer have an exact value, but a rounded value to 2 dps.

    By putting it into a Variable the Tax is never applied to the actual cost, dTotalExTax,
    Plus the Double Type Variable holds a hell of alot more DPs, so your values are exact every time you perform your calculations.

    I'm up late because I love to punish myself and my Wifes working late.

    ------------------
    Aaron Young
    Analyst Programmer
    [email protected]
    [email protected]

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Nov 1999
    Location
    Calgary,Alberta, Canada
    Posts
    70

    Post

    hmm the things they never tell you I can't even find the row data property in the book i have

    now i guess i could use that also when i want to save the grid to a file could i not
    eg open strfilename for append as intfreefile

    print,grdmovieselect.rowdata

    or am i out to lunch
    i noticed you play pool do you play in any
    leagues eg Players , Valley or Bca

  4. #4
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,177

    Post

    RowData is like the Listbox/Combobox ItemData Property and can only hold Numeric Values, which is what makes it useful for storing Indexes to Arrays or Other Controls.

    So you could use something like:
    Code:
    Dim iFile As Integer
    Dim iIndex As Integer
    iFile = FreeFile
    Open "C:\SaveMovies.txt" For Output As iFile
    For iIndex = 1 To grdSelect.Rows - 1
        With S_TagMovieFile(grdSelect.RowData(iIndex))
            Print #iFile, .strMovieName & "|" & .dblPrice
        End With
    Next
    Close iFile
    The Pool Playing is Purely Recreational, I'm not in any Leagues.
    ------------------
    Aaron Young
    Analyst Programmer
    [email protected]
    [email protected]


    [This message has been edited by Aaron Young (edited 11-19-1999).]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width