The ISML function hasElements() allows you to check whether an iterator stored in the pipeline dictionary contains any elements. This is particularly useful before looping through an iterator using a ISLOOPstatement. If your iterator contains a number of elements different from 0
, the function returns true
, otherwise false
.
Note
The functions hasElements()
and hasLoopElements()are synonyms.
hasElements( <ISML variable identifier> )
<ISIF condition = "#hasElements(Basket:Offerings)#">Your basket contains: <ISLOOP iterator = "Basket:Offerings"> <ISPRINT value = "#Offerings:Name#"><BR> </ISLOOP> <ISELSE> <!-- Your basket contains nothing --!> </ISIF>