foreach_arrayed_looping_construct_.htm
Navigation: Clarion.Net (Clarion#) > Clarion# Language Extensions > Control Structures >====== FOREACH (arrayed looping construct) ====== | |
label | FOREACH ( element IN object/array ) |
Statements | |
YIELD (expression) | |
END |
FOREACH | Test every element in a defined array |
element | The reference to each array element |
IN | Required clause in FOREACH that separates the element from the array. |
object/array | the label of the target array |
YIELD | Returns an expression |
FOREACH is used to loop through a target array of elements. YIELD appears only inside the FOREACH block and returns the value that is expected by the calling FOREACH statement. Multiple YIELD statements are permitted.
Example:
MainForm.MnuProductClick PROCEDURE(System.Object sender, System.EventArgs e)
Frm &System.Windows.Forms.Form
FrmFound BOOL
CODE
FrmFound = FALSE
Frm &= NULL
FOREACH Frm IN SELF.MdiChildren
IF Frm IS Warehouse.ProductsBrowseForm THEN
FrmFound = TRUE
BREAK
END
END
IF FrmFound THEN
Frm.Activate()
ELSE
Frm &= NEW Warehouse.ProductsBrowseForm
Frm.MdiParent &= SELF
Frm.Show()
END
1.
foreach_arrayed_looping_construct_.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1