Forums Register Login

How can I evaluate in some conditions?

+Pie Number of slices to send: Send
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)
+Pie Number of slices to send: Send
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.
She still doesn't approve of my superhero lifestyle. Or this shameless plug:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 455 times.
Similar Threads
tomcat session problem
selectOneMenu VCL not firing
hibernate-annotations error
some qns...help appreciated
Generate random strings
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 15, 2024 22:06:25.