Flurin
Member
\"Get Next Selected Row\" System Function - Odd behaviour (?)
Hi all
I spend this morning trying to find out why the following code failed:
<font class="small">Code:</font><hr /><pre>
evt_currentRow_INT01
evt_maxRows_INT01
0001 // Initialise variables
0002 Get Next Selected Row(FC Grid, <Before First Row>, VA evt_currentRow_INT01)
0003 Get Selected Grid Row Count(FC Grid, VA evt_maxRows_INT01)
0004 //
0005 // Iterate through selected rows
0006 While VA evt_maxRows_INT01 is greater than <Zero>
0007 // Process current row
0008 Set Grid Color(FC Grid, VA evt_currentRow_INT01, <All Columns>, <Red>)
0009 //
0010 // get next row
0011 Get Next Selected Row(FC Grid, VA evt_currentRow_INT01, VA evt_currentRow_INT01)
0012 VA evt_maxRows_INT01 = VA evt_maxRows_INT01-1
0013 End While
</pre><hr />
When multiple rows were selected, only the first call to the "Get next selected row" worked, while any subsequent would return -1 as the next row number.
I have since established that this only happens when there are hidden rows in the grid. When all are shown, the code highlights the selected rows as expected.
The pertinent grid is on a subform and I work with app release E812 and tool release 8.97.
I am curious to know why the function returns -1 on a grid with hidden rows. Is this expected behaviour or a bug?
PS: I have changed my approach to avoid using this function, so I am not looking for alternate solutions.
Regards,
Flurin
Hi all
I spend this morning trying to find out why the following code failed:
<font class="small">Code:</font><hr /><pre>
evt_currentRow_INT01
evt_maxRows_INT01
0001 // Initialise variables
0002 Get Next Selected Row(FC Grid, <Before First Row>, VA evt_currentRow_INT01)
0003 Get Selected Grid Row Count(FC Grid, VA evt_maxRows_INT01)
0004 //
0005 // Iterate through selected rows
0006 While VA evt_maxRows_INT01 is greater than <Zero>
0007 // Process current row
0008 Set Grid Color(FC Grid, VA evt_currentRow_INT01, <All Columns>, <Red>)
0009 //
0010 // get next row
0011 Get Next Selected Row(FC Grid, VA evt_currentRow_INT01, VA evt_currentRow_INT01)
0012 VA evt_maxRows_INT01 = VA evt_maxRows_INT01-1
0013 End While
</pre><hr />
When multiple rows were selected, only the first call to the "Get next selected row" worked, while any subsequent would return -1 as the next row number.
I have since established that this only happens when there are hidden rows in the grid. When all are shown, the code highlights the selected rows as expected.
The pertinent grid is on a subform and I work with app release E812 and tool release 8.97.
I am curious to know why the function returns -1 on a grid with hidden rows. Is this expected behaviour or a bug?
PS: I have changed my approach to avoid using this function, so I am not looking for alternate solutions.
Regards,
Flurin