nktasingh Posted June 22, 2015 Report Share Posted June 22, 2015 Hello! I need to execute an action on every row in a data table. To write this like a for-loop, I need the number of rows in the table so I can iterate through. Is there a way to get the number of rows in a table without hard coding it? I need this to work generically, where the number of rows in the table aren't fixed. If this isn't possible, is there another way of going about executing something on every row in the data table? Thanks! Link to comment Share on other sites More sharing options...
Gabriel Franco Posted June 22, 2015 Report Share Posted June 22, 2015 The number of rows are fixed. You can use empty rows set with zeroes, so you can use "datatable find" tool to get last row with valid data. Link to comment Share on other sites More sharing options...
Paul Rylatt Posted July 7, 2015 Report Share Posted July 7, 2015 Create a dynamic data table with a row counter. In this way, when adding rows the counter will increase and when removing rows the counter will decrease. It will even work when adding/removing rows internal to the data table, not just at the end. Store the row counter in its own data table with one row, Row 0. Also, store the max number of rows written to and store in the same data table and row as the row counter. Remember the first row is always Row 0. All processing loops through the row counter. It will even allow you to loop from the last row to the first row and in reverse. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now