Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

this question quite math - -' (simple java condition)

 
Thanaphorn Thongthien
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i need the results of specific index which is the last value that need to show and use to calculate next... example like results below

i only need the red result

-----------------------------------------------
value compare:: widthCut 53.00and jobWidthMulti 5.00
indexJobWidth ----1
value compare:: widthCut 53.00and jobWidthMulti 10.00
indexJobWidth ----2
value compare:: widthCut 53.00and jobWidthMulti 15.00
indexJobWidth ----3
value compare:: widthCut 53.00and jobWidthMulti 20.00
indexJobWidth ----4
value compare:: widthCut 53.00and jobWidthMulti 25.00
indexJobWidth ----5
value compare:: widthCut 53.00and jobWidthMulti 30.00
indexJobWidth ----6
value compare:: widthCut 53.00and jobWidthMulti 35.00
indexJobWidth ----7
value compare:: widthCut 53.00and jobWidthMulti 40.00
indexJobWidth ----8
value compare:: widthCut 53.00and jobWidthMulti 45.00
indexJobWidth ----9
value compare:: widthCut 53.00and jobWidthMulti 50.00
indexJobWidth ----10

================================================================
value compare:: widthCut 35.00and jobWidthMulti 5.00
indexJobWidth ----1
value compare:: widthCut 35.00and jobWidthMulti 10.00
indexJobWidth ----2
value compare:: widthCut 35.00and jobWidthMulti 15.00
indexJobWidth ----3
value compare:: widthCut 35.00and jobWidthMulti 20.00
indexJobWidth ----4
value compare:: widthCut 35.00and jobWidthMulti 25.00
indexJobWidth ----5
value compare:: widthCut 35.00and jobWidthMulti 30.00
indexJobWidth ----6
value compare:: widthCut 35.00and jobWidthMulti 35.00
indexJobWidth ----6

================================================================

and this is my code.....




how can i solve it to get and show only last value ? i need help - -'

ps. actually the widthCut[] and lengthCut require to query from database << but i cann't do it !! T_T
 
Henry Wong
author
Marshal
Pie
Posts: 20997
76
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

One possible option... Remove the printf() calls. And replace it with assignments (to some results variable) that will save the data needed for the print out. And right after the loop, do the printf() based on the results variable.

Henry
 
Thanaphorn Thongthien
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
...thank you so much for reply me

and actually there have more than 30 expected result set

but thank you by the way
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic