vb.net - I want to create a package check on vb, but my codes aren't working any suggestion? -


i can't think of other way make work, suggestions? codes:

public class frmpackagecheck

private sub btncheck_click(sender object, e eventargs) handles btncheck.click     if txtweight.text <= 27         me.lblanswer.text = "accepted"     elseif txtweight.text >= 27         me.lblanswer.text = "rejected: heavy"     end if     if txtlength.text <= 100         me.lblanswer.text = "accepted"     elseif txtlength.text >= 100         me.lblanswer.text = "rejected: large"     end if     if lblwidth.text <= 100         me.lblanswer.text = "accepted"     elseif txtwidth.text >= 100         me.lblanswer.text = "rejected: large"     end if     if txtheight.text <= 100         me.lblanswer.text = "accepted"     elseif txtheight.text >= 100         me.lblanswer.text = "rejected: large"     end if end sub 

your problem me.lblanswer.text keeps getting changed. example, if weight 50, answer text set "rejected: heavy", in next if-block replaced (either "accepted" or "rejected: large"). should continue checking more values only if state 'accepted'. once rejection reason found, should report it.

alternately can build more complicated answer text either combination of rejection reasons, or 'accepted'. more complicated program find problems in 1 pass.


Comments

Popular posts from this blog

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - UML - How would you draw a try catch in a sequence diagram? -

c++ - No viable overloaded operator for references a map -