Using IF with CheckBoxes =S *Question*

  • (2 Pages)
  • +
  • 1
  • 2

19 Replies - 839 Views - Last Post: 30 July 2013 - 05:23 PM Rate Topic: -----

#16 andrewsw  Icon User is online

  • Fire giant boob nipple gun!
  • member icon

Reputation: 3480
  • View blog
  • Posts: 11,874
  • Joined: 12-December 12

Re: Using IF with CheckBoxes =S *Question*

Posted 30 July 2013 - 02:52 PM

It's nice when people come back to confirm the solution :bigsmile:

.. although.. if they check and uncheck the item several times, won't it continue to decrease the value :whatsthat:
Was This Post Helpful? 2
  • +
  • -

#17 kwontum  Icon User is offline

  • New D.I.C Head

Reputation: -20
  • View blog
  • Posts: 19
  • Joined: 24-July 13

Re: Using IF with CheckBoxes =S *Question*

Posted 30 July 2013 - 03:00 PM

View Postandrewsw, on 30 July 2013 - 02:52 PM, said:

It's nice when people come back to confirm the solution :bigsmile:/>

.. although.. if they check and uncheck the item several times, won't it continue to decrease the value :whatsthat:/>

Haha i was waiting for some one to mention that >.>
Thats my next fix ^.^ hence 'Working'

Yes updating progress is a must for me. As if i give a solution to a problem i have never encountered i would like to know if i contributed to the solution. =) Thank you again for your help. :genius:
Was This Post Helpful? 0
  • +
  • -

#18 andrewsw  Icon User is online

  • Fire giant boob nipple gun!
  • member icon

Reputation: 3480
  • View blog
  • Posts: 11,874
  • Joined: 12-December 12

Re: Using IF with CheckBoxes =S *Question*

Posted 30 July 2013 - 03:50 PM

What you need to do is leave the original Value(s) untouched, and only apply the deduction to the displayed value:

lbx.Items.Add("It will cost " + textBox2.Text + " $"
     + itm.Value + " To travel to " + itm.Name);

If you alter the original Value then you'll need to store all the original values somewhere else (another List perhaps or a Class) and it becomes complicated, and more error prone.
Was This Post Helpful? 1
  • +
  • -

#19 andrewsw  Icon User is online

  • Fire giant boob nipple gun!
  • member icon

Reputation: 3480
  • View blog
  • Posts: 11,874
  • Joined: 12-December 12

Re: Using IF with CheckBoxes =S *Question*

Posted 30 July 2013 - 04:09 PM

This is, actually, a generally accepted practice (I suggest). The original values, or costs, of items are maintained throughout. Only when displaying additional information, or a summary, are deductions or additions performed (but not on the original values).

Even then, the additions or deductions are recalculated when an order is made. (For a website, the calculations are all repeated again, from scratch, on the server.)
Was This Post Helpful? 1
  • +
  • -

#20 kwontum  Icon User is offline

  • New D.I.C Head

Reputation: -20
  • View blog
  • Posts: 19
  • Joined: 24-July 13

Re: Using IF with CheckBoxes =S *Question*

Posted 30 July 2013 - 05:23 PM

View Postandrewsw, on 30 July 2013 - 03:50 PM, said:

What you need to do is leave the original Value(s) untouched, and only apply the deduction to the displayed value:

lbx.Items.Add("It will cost " + textBox2.Text + " $"
     + itm.Value + " To travel to " + itm.Name);

If you alter the original Value then you'll need to store all the original values somewhere else (another List perhaps or a Class) and it becomes complicated, and more error prone.

A little bit above my league currently, how ever I am sure i will use this later :euro:
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2