Posted By
|
Message
|
marco souza
Registered 12/04/2013 15:00:37
Points 6
|
15th April, 2013 at 15/04/2013 03:41:30 -
Hey guys, I'm here trying to build and app that compares the text of the lines of a list object with the cells of a datagrid object, and do an action if equal.
If I would make it using C, I would use like this [considering the list as an unidimensional array and the datagrid as a bidimensional array]
for (i=0;i<numberoflines;i++){
for (j=0;j<numberofcolumnsdatagrid;j++){
for(k=0;k<numberoflinesdatagrid;k++){
if (listobject == datagrid(i,j))
action;
}
}
}
.
Ok! But, how to do it using MMF2? I can't even think about a solution. I just have no clue about what to do... Actually, I have, but the idea was to make a condition for every line of the list, comparing with every cell of datagrid... But it would be HUGE, since I got about 50 lines of a list and like 30 cells of datagrid.
Any help?
Regards,
n/a
|
OMC What a goofball
Registered 21/05/2007
Points 3516
|
15th April, 2013 at 15/04/2013 06:47:41 -
Nested looooops!
Things after + are conditions.
Things after - are actions.
Things after || are in the expression editor.
+Start of Frame (or whatever you want to trigger everything):
-Special Object > Fast loops > Start loop || Loop name "listLines" || Number of loops: List Nb Lines( "List" )
+Special Object > On Loop || Loop name: "listLines"
-Special Object > Fast loops > Start loop || Loop name "dataGridColumns" || Number of loops: Number of columns
+Special Object > On Loop || Loop name "dataGridColumns"
-Special Object > Fast loops > Start loop || Loop name "dataGridRows" || Number of loops: Number of rows
+Special Object > On Loop || Loop name "dataGridRows"
+Special Object > Compare two general values || List Line Text$( "List", LoopIndex("listLines")) = Datagrid space selected by LoopIndex("dataGridColumns") and LoopIndex("dataGridRows").
-Do stuff!
Sorry I can't be exact on the data grid parts. I don't have MMF2 Dev.
It could be that this won't work at all and is a terrible idea! But you should try it.
|
|
|