Script functions reference > Script functions in alphabetical order > N > NumberOfEvents

NumberOfEvents
Syntax
NumberOfEvents();
Description
Counts the number of Events in a job. The function is not supported in Post-processor scripting.
Returns
A number indicating the number of Events in the current job.
Example
The following example is a Before-Process script, where there is one Process per Event and the desired output is:
proc1, proc n/2, proc2, procn/2+1, etc
if($nproc="")
{
$nev2=NumberOfEvents()/2;
$lowerpart="0";
$upperpart="1";
}
$nproc++;
if(num($nproc) <= num($nev2))
{
sort("xx.", $lowerpart);
$lowerpart += 2;
}
else
{
sort("xx", $upperpart);
$upperpart += 2;
OpenText StreamServe 5.6 Updated: 2013-03-01