|
-
May 28th, 2002, 08:18 AM
#6
Addicted Member
Exactly, you wouldn't use the Count property.
If you think about what we were really doing in the example i put up before, we were making sure (with the If statement) that the index that we were using (currentRow) was valid, that is, that it was not greater than Count - 1.
Now, that was for the Next operation...the Previous operation is effectively navigating thru the rows of the table in the opposite direction.
So instead of making sure that currentRow is not greater than Count - 1, we want to make sure that currentRow is not less than 0 (remember that the index for the collection goes from 0 to Count - 1).
Also, instead of incrementing currentRow, we want to decrement it.
That should be enough i hope, have a tinker with the code you should be able to get it - the concept is that we are doing the same as for the Next operation, but instead of incrementing we are decrementing the currentRow, and instead of making sure it is < Count - 1 before incrementing, we want to make sure that is is > 0 before decrementing. Otherwise we set it to the index bound (0 this time instead of Count - 1).
funky
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|