Cobra Inline Programs predefined values

NAME

predefined values

DESCRIPTION

The following integer and boolean values are predefined:
	cpu	# the id of the currently executing core
	core	# a synonym for cpu
	ncpu	# the total number of cores being used
	ncore	# a synonym for ncpu
	terse	# nonzero if terse mode is enabled
	verbose	# nonzero if verbose mode is enabled
	true	# a synonym for 1
	false	# a synonym for 0
All these values and references are read-only, so they cannot be modified inside inline programs. The number of cores used and the choice between terse and verbose execution can be modified with standard query commands outside inline programs.

EXAMPLES

A typical use of the terse and ncore values is:
	: ncore 1	# ncore can be changed with a query command
	%{
		if (@ident)
		{	.mark++;
			if (!terse && ncore == 1)
			{	print .fnm ":" .lnr " " .txt "\n";
		}	}
	%}

Inline Programs
Manual
Tutorial
(Last Updated: 17 August 2023)