Get Next Selected Row grid system function

johndanter

johndanter

Legendary Poster
Hi List,

Does this system function actually do anything?

I have my grid loop processing fine but then I saw this and decided to use it to handle 'gaps' in the grid row selection.

However the INT01 I use in the return field never changes. It just stays on the same value.

I maybe using it wrong as I have a loop within my hidden button to process the grid using Get Selected Grid Row Count / Get Grid Row etc

Any tips? I've seen posts on this on JDETools but I'm not paying to get the answer :)

Does anyone have ER as an example of where they've used it fine please?

Ta

John
 
Last edited:
John,

Note: The selected area need not consist of contiguous rows.

From the manual:

Get Next Selected Row
Use this system function to determine the next selected grid row after a given row.​

Parameters
Grid
Input, required. The grid FC to affect.
Start Row
Input, required. The row from which to start searching for a selected row. In other words, runtime will return the first row it finds, after this row, that has been selected. To include the first row of the grid in the search, select the special parameter, <Before First Row>. Set the parameter to <Before First Row> or an applicable object from the object list.
Row
Output, required. The object to which to assign the return value. Set the parameter to an applicable object from the object list.​

Returns
This system function returns the index of the first selected row the system encounters beneath the indicated row. Runtime writes the index to the object specified by Row.​
 
Cheers Peter

Thanks for this. I have the manual and have done what it says. I just do not see the output value increasing.

I got this to work in the end by placing this in a button with Repeat for Grid ticked. It works but then it deselects all my selected grid rows when done.
I need 2 loops.
1 to validate, then another to process
 
I've used the following code many times in row exits.
It doesn't need to the Repeat for Grid checked and it doesn't deselect the rows.
You just need two INT variables.

// init variables
evt_iLineIn_INT01 = "0"
evt_iLineOut_INT01 = "0"
// get first row
Get Next Selected Row(FC Grid, <Before First Row>, evt_iLineOut_INT01)
While evt_iLineOut_INT01 is greater than evt_iLineIn_INT01
Get Grid Row(FC Grid, evt_iLineOut_INT01)
// do something with the GC
evt_iLineIn_INT01 = evt_iLineOut_INT01
Get Next Selected Row(FC Grid, evt_iLineIn_INT01, evt_iLineOut_INT01)
End While
 
Awesome, cheers Trevor

Works like a charm......in THIN :)

I think the issue was these new system functions don't work that well if you run your app old school FAT....?

Anyway, thank you it's awesome
 
Last edited:
Back
Top