Fisheries and Oceans Canada / Pêches et Océans Canada - Government of Canada / Gouvernement du Canada Fisheries and Oceans Canada / Pêches et Océans Canada - Government of Canada / Gouvernement du Canada
 
Français Contact Us Help Search Canada Site
Home What's New DFO National Site Map Media

Fisheries & Oceans
 
 
Maritimes Region
Fishing Industry
General Public
Marine & Oceans Industry
Media
Students and Teachers
Scientists and Researchers
 
AconIcon ACON       Home/Topics   |   Commands

Printing


The printing functions include: Print, Print Graph, Print Precision, Print Width, Backslash \, and Save Output.


Print

The print command prints it arguments in a formatted form to the output list device. If an argument is undefined, a "NIL" string is printed.

Any arguments are allowed.

Print(any values passed as arguments);

print("Hello World"," from ACON ",5);
Hello World from ACON 5

Print Graph

The print_graph command prints the graph window.

Print_graph();

This command is specific to the ACON_GUI version of ACON.


Print Precision

This command sets the print precision to be used when printing. The printing precision is the number of decimal digits printed for floating point numbers.

There is 1 parameter:
digits - the number of decimal places to print. The default is to print only to the resolution of the data (digits = -1).

Print_Precision(digits);

/* only prints 1 digit here as that is the implicit resolution of this data */
print(1.5)
1.5
print_precision(12);
print(1.5)
1.500000000000
print_precision(-1); /* restore default */

Print Width

This command sets the print width to be used when printing. The printing width is the number of characters per line printed to the output device.

There is 1 parameter:
width - the number of characters to print. The default is 72.

Print_Precision(width);

print_width(150);


Backslash \

The \ operator may be used to set the print precision for numeric output for an immediate output line. This operator is added as the last object of the command line.

There are 2 parameters:
left side - any numeric output.
right side - the immediate print precision for this line.
seq(1,10.1,2.3333) \ 1
1.0 3.3 5.7 8.0

Save Output

This command specifies the name of the output file to use to store execution output into. The current file is closed and new output is written to the new output file. If the name is a null string, the current file is closed, but the output file name is not altered.

There is 1 parameter:
output file name - the name of the new output file to write the results to.

Save_Output("output file name");

Save_Output("mySaveFile");


AconIcon ACON       Home/Topics   |   Commands



Last Modified : 2003-11-19