Is it possible to skip selected rows when going through a grid with meta loop? How to do it if it's possible?
For Each Row GridP
+If Not Selected
But action diagram did not accept that.
no you cant but have used
before to process all NOT selected rows
Okay, thanks for the information.
will try and dig up the some source that tests if a row is selected which would be most helpful for you. It is possible as the runtime does it! The CA runtime has to abide to the same rules outlined in http://wiki.plexinfo.net/index.php?title=WinWidgets
On the "Select Grid" event , store the selected grid values in a temp variable.(TempSelectedGridP). Have Key fields in the temp variable.
If GridP != TempSelectedGridP
... Do your process
Only works if grid property Single Row Select is set to Yes.
C:\Program Files (x86)\CA\Plex\6.1\include\WIDGETS.H
*So you will do something like
WINAPI/SelectGridRow, WINAPI/DeselectGridRow, WINAPI/ReverseGridRowSelection
HWND hwndGrid = ObPanelAPI::GetControlHandleByName (ControlName);SendMessage(hwndGrid, HGM_SELECTROW, RecordNumber,0);
HWND hwndGrid = ObPanelAPI::GetControlHandleByName(ControlName);SendMessage(hwndGrid, HGM_TURNONROW, RecordNumber,0);
HWND hwndGrid = ObPanelAPI::GetControlHandleByName(ControlName);SendMessage(hwndGrid, HGM_TURNOFFROW, RecordNumber,0);
The name of the grid control, as specified by its Control Name property in the Panel Designer.
The number of the row in the grid.
Note: The first row is in the grid is 0 (not 1).
Use these APIs to select and deselect rows on a Windows grid:
The APIs support multiple selections, so selecting a row adds it to the existing set of selected rows. The grid scrolls to make the row visible before it is selected or deselected (if necessary). If you only require single selections note that you can use the Locate field statement for this purpose.
Note that the record number of the first row in the grid is 0. Within a For Each Row loop you can increment a counter in order to determine the record number (see example). In other situations it is more difficult to determine the record number since it changes dynamically when, for example, individual rows are deleted from the grid.
Note: These APIs do not work correctly if the Whole Row Selection property is set to No or if the Single Selection property is set to True. Avoid using these properties in conjunction with these APIs.
The following code supports a Select All menu command on a typical OBASE grid. Note that this selects only those records that have been loaded into the grid (not necessarily all records in the associated database table). You can use the TurnOffRow and SelectRow APIs to create Deselect All and Invert Selections menu commands in the same way.
Edit Point Additional Events Event Event: SelectAll Set Local<record number> = <record number.-1> For Each Row Grid Set Local<record number> = Local<record number> + <record number.1> API Call Source code: Select Row
The source code for the API looks like this:
HWND hwndGrid = ObPanelAPI::GetControlHandleByName("Grid");SendMessage(hwndGrid, HGM_TURNONROW, &(1:),0);
In this example, the Control Name property of the grid control must be set to "Grid" (without the quotes).
Copyright © 2008 CA. All rights reserved.
Yep it works
Just tested in AutoIt - AutoIt
No this could work..have not tested the boolean test in this example but you get the idea.
Please mark as correct if you feel and get back to us on your findings as this has taken me time to do for you!
Ok, thanks a lot for studying the problem!
I'll bookmark this so Ill come back when I can look these when I need this functionality.
but this is what you asked for.
+If Not Selected
You cant do this so you could do exactly this with this source
int = 0
Int = int + 1
Row is Selected
Row is not Selected
Yes, my original question was just if looping unselected rows would be possible with meta code. Now I know that it isn't possible using only meta code, but a api function is also needed. I think it would not hurt if that condition could also be implemented in meta loop.
Thanks again for your help.
Meta-Loop: A type of action diagram meta-operation that causes the generator to iterate through instances of certain objects. The objects concerned are determined by the type of meta-loop. For example, the +For Each View meta-loop iterates through each object (field or attribute) belonging to a specified view.
Looping using meta code is only during generation time.
Any action diagram statement that does not contain a prefix of "+" is normal A/D.
There are things that normal A/D can do and use of meta code is for largely for creating abstract solutions.
You cannot loop thru Grid rows using meta code.
Thanks for clarifying that. I really have made a mistake in this thread, talking about meta loops when the loop used is actually a normal action diagram loop.