Index

print $datatype(expr) | $function(args) | $variable | "string", ...

Print one or more arguments according to their types.

Arguments:
argument
A value to be printed. This can have any one of the following forms:
  • $datatype(expression)
    Where datatype is the name of a datatype, and expression is an expression of that type.
  • $function(args)
    Where function is the name of any function and args are its arguments.
  • $variable
    Where variable is the name of a scalar variable. If this is an aggregate type then it must be followed by a valid field selection expression that refers to a scalar member of the aggregate, or that of a sub-aggregate.
  • "string"
    Where "string" is an ASCII string, optionally containing C-style escape sequences.

Example:
The following example reports on the start of each new source.
 foreach(Source s) {3c345, 3c273, 0552+398} {
   print "Starting observation of ", $s, " at ", $time(UTC), ".\n"
   track $s
   until $elapsed > 1m
 }
Context:
The print command allows you to display the values of variables, literal strings, and the return values of functions.

Use of this statement by interactive cbiviewer clients, results in the printed message only appearing in the originating client's message window. However when it used within a scheduling script, the message is displayed in the message windows of all connected clients, as well as being recorded in the log. To interactively write a message to the log, use the otherwise identical log command.


Martin Shepherd (26-Feb-1999)