once
once { statements; } else { statements }
once () statement; else: statement
once () { statements; }
Executes the following statement or block only for the first time and once. Further executions of this function will skip that code. This feature is very useful for repeated invocations of code (with start() or include()) or user defined functions and procedures where specific code should executed only once during the first invocation, e.g. blocks where variables are initialized and functions being defined.
Indirect parameter passing is disabled
0
define procedure ( hi )
{
once()
echo(Hey folks);
else:
echo(Good bye);
}
// Main program part: Call 'hi' three times:
hi;
hi;
hi;
Hey folks
Good bye
Good bye