Loop question

jeudi 2 avril 2015

Here is another hypothetical question. If I have a form with ten text boxes. text boxes 2 through ten have a default value of the previous value plus 1. So....



TEXTBOX1

TEXTBOX2 default value =[textbox1] +1

TEXTBOX3 default value =[textbox2] +1

TEXTBOX4 default value =[textbox3] +1

TEXTBOX5 default value =[textbox4] +1

TEXTBOX6 default value =[textbox5] +1

TEXTBOX7 default value =[textbox6] +1

TEXTBOX8 default value =[textbox7] +1

TEXTBOX9 default value =[textbox8] +1

TEXTBOX10 default value =[textbox9] +1





So if I enter 239 in textbox1 I get



239

240

241

242

243

244

245

246

247

248



Then If I change textbox2 to 242 it's



239

242

243

244

245

246

247

248

249

250





And now I cahnge textbox3 back to 240



239

242

240

241

242

243

244

245

246

247



Now I have 242 for the value of textbox2 and textbox5. So the question is how can I write a loop that will look at the previous textboxes and if a number exists skip to the next number that doesn't exist ina any of the previous textboxes?

Loop question

0 commentaires:

Enregistrer un commentaire

Labels