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 ", $format_double("08s",$time(utc)), " UTC"
   track $s
   until $elapsed > 0:1:0
 }
The start of the first iteration of the above loop would print the following:
 Starting observation of 3c345 at 16:22:06 UTC
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 telviewer clients, results in the printed message only appearing in the originating client's message window. However when it is 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.

Formatting:
The following functions are available for specifying how specific values are formatted:
Formatting function Description
$format_double() Format a Double value

Martin Shepherd (04-Nov-2010)