Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Visual Basic (http://www.programmingforums.org/forum18.html)
-   -   Format Exception Error (http://www.programmingforums.org/showthread.php?t=11992)

dwizzle13 Nov 24th, 2006 7:37 PM

Format Exception Error
 
Hi, I have a format exception error when I try and calculate the price of a product and service in a program using menu bars in vb. I'm not sure what's wrong except there's an error with index(zero-based) not being the correct size. Here's the small portion of the code (the error is in a portions like this.)
:

If rad2.Checked = True Then
            If radF.Checked = True Then
                total = 12.0
                'add deposit and display
                Deposit = 30.0
                total = total + Deposit
                total = FormatCurrency(total, 2)
                lstOutput.Items.Add(String.Format(fmtTable, "Lawn mower  ", FormatCurrency(12.0, 2), "(Full-day rental)"))
                lstOutput.Items.Add(String.Format(fmtTable, "Deposit", FormatCurrency(Deposit, 2)))
                lstOutput.Items.Add("----------------")
                lstOutput.Items.Add(String.Format(fmtTable, "Total", FormatCurrency(total, 2)))
            End If


Just please tell me what to do to correct it, I only know up to menubars and select case, it's for my comp. science class. Thanks.


All times are GMT -5. The time now is 12:47 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC