Spot the error lol

Discussion in 'Programming General' started by matt_sells, Jan 30, 2012.

Spot the error lol
  1. Unread #1 - Jan 30, 2012 at 8:42 PM
  2. matt_sells
    Joined:
    Nov 28, 2011
    Posts:
    78
    Referrals:
    0
    Sythe Gold:
    0

    matt_sells Member

    Spot the error lol

    Code:
    Label17.Text = Label1.Text + Label2.Text
            Label10.Text = ((Val(Label1.Text) / Val(Label17.Text)) * Val(100))
    actually just spent 10 minutes totally confused as to why it wasn't doing what it should lol
     
  3. Unread #2 - Jan 31, 2012 at 1:19 AM
  4. Covey
    Joined:
    Sep 9, 2005
    Posts:
    4,510
    Referrals:
    9
    Sythe Gold:
    9
    Discord Unique ID:
    807246764155338833
    Discord Username:
    Covey#1816

    Covey Creator of EliteSwitch
    Retired Sectional Moderator Visual Basic Programmers

    Spot the error lol

    val(100) or no val() around label1 & label2.
    You also leave yourself open to errors if label7 = 0.
     
  5. Unread #3 - Jan 31, 2012 at 2:33 PM
  6. Nullware
    Joined:
    Jan 30, 2007
    Posts:
    1,761
    Referrals:
    4
    Sythe Gold:
    0

    Nullware Guru

    Spot the error lol

    I'm guessing the first line just concatenates strings rather than getting the sum you were probably intending.
     
  7. Unread #4 - Jan 31, 2012 at 8:40 PM
  8. matt_sells
    Joined:
    Nov 28, 2011
    Posts:
    78
    Referrals:
    0
    Sythe Gold:
    0

    matt_sells Member

    Spot the error lol

    yea literally spent 10 minutes figuring that out, I just couldn't see it lol
     
< C program problem | AutoTyper >

Users viewing this thread
1 guest


 
 
Adblock breaks this site