Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
do(
   $outputString = "Can't find Wally..."
   
   forEach($manager, $managersList
   	  
	  if($manager = "Wally",
   	     do(
		    $outputString "Found Wally!"
   	        break()
		 )
   	  )
   ),
   
   //output the result
   $outputString
)   

...

In the above expression the forEach() function will check each prefix in turn until it finds a prefix length greater than 20 at which point a debug message will be printed out to the log and break() will be called which causes the loop to stop processing.

Note that the call to break() exits both the (inner) do() routine, and the (outer) forEach() - but not the current stream processing cycle.

...