• Post Reply Bookmark Topic Watch Topic
  • New Topic

How can I evaluate in some conditions?  RSS feed

 
qingwu wang
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Everyone!
I have a question as following,
if(lengh>1)
oldValue=sumLBonus;//sumLBonus is a sum value
..........
if(length>2)
oldValue=sumLBonus;
...........
How can I make the first oldValue keep fixedness after it gets value of sumLBonus util (length>2).this snippet will be excuted again and again so sumLonus perhaps is changed.because every time loop the first place oldValue will be evaluated,I want to keep it fixedness after it get value in the first time util length>2,it will get new value which is gotten from (length>2)
 
John Hembree
hired gun
Ranch Hand
Posts: 250
MS IE Oracle Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I understand your question correctly, you could reverse your logic and put length>2 before length>1. This will make the most restrictive check occur first.
You might also look into a switch statement possibly.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!