L le_toubib Active Member Licensed User Longtime User Apr 8, 2015 #1 hi all in the following code : Code: Copy For i =0 To Q_count.Text-1 For ii = 0 To catcount.Text - 1 Step -1 If i > catplaces.Get(catcount.Text-1) Then question(i).catego = cat.Get(catcount.Text-1) End If If i <= catplaces.Get(ii) Then question(i).catego = cat.Get(ii) End If Next Next if i put a breackpoint inside any line inside the inner (backwards) loop , e.g If i > catplaces.Get(catcount.Text-1) Then the breackpoint is never reacheable, and indeed the code is not executed. what am i missing here ?
hi all in the following code : Code: Copy For i =0 To Q_count.Text-1 For ii = 0 To catcount.Text - 1 Step -1 If i > catplaces.Get(catcount.Text-1) Then question(i).catego = cat.Get(catcount.Text-1) End If If i <= catplaces.Get(ii) Then question(i).catego = cat.Get(ii) End If Next Next if i put a breackpoint inside any line inside the inner (backwards) loop , e.g If i > catplaces.Get(catcount.Text-1) Then the breackpoint is never reacheable, and indeed the code is not executed. what am i missing here ?
Daestrum Expert Licensed User Longtime User Apr 8, 2015 #2 The step -1 looks suspicious as you start at zero, unless catcount.Text is always negative. Possibly you meant catcount.Text - 1 to 0 step -1 Last edited: Apr 8, 2015 Upvote 0
The step -1 looks suspicious as you start at zero, unless catcount.Text is always negative. Possibly you meant catcount.Text - 1 to 0 step -1
L le_toubib Active Member Licensed User Longtime User Apr 9, 2015 #3 Aha , you are right , that's what I meant. Thanks a million Upvote 0