Getting Started Documentation Glish Learn More Programming Contact Us
Version 1.9 Build 1556
News FAQ
Search Home


next up previous
Next: Clients, Events, and Agents Up: NOTE 195 Getting Started with Glish for AIPS++ Previous: Strings

Printing

The print statement is quite primitive so output formatting in glish is minimal. The output of print is simply the concatenation of the quantities listed converted to strings and separated by spaces. You can add spaces by printing spaces in single quoted strings, and you can control the number of decimal places shown for floating point numbers with one of two print precision variables.

- r := 3; s := 5.6; j := "spa   ces"
- print '     show', r, s, j
     show 3 5.6 spa ces

The printed precision of all floating point variables is set by the value of a member of the system record variable.

- old_prec := system.print.precision
- system.print.precision := 3
- x := 234.12345
- print x
234
- system.print.precision := old_prec

The printed precision of one variable may be set by the member of the variable's print attribute.

- x::print.precision := 4
- print x
234.1

To avoid the possibility of inadvertently printing a huge array to the screen, you can set a limit on the number of printed array elements with

- system.print.limit := 50
or
- any_array::print.limit := 50

The effects of print.precision or print.limit may be cancelled by setting them to a value less than zero. You may want to set a system print limit in your .glishrc file. See Appendix A and Getting Started in AIPS++ for more details on the role and uses of your .glishrc file.


next up previous
Next: Clients, Events, and Agents Up: NOTE 195 Getting Started with Glish for AIPS++ Previous: Strings
Please send questions or comments about AIPS++ to aips2-request@nrao.edu.
Copyright © 1995-2000 Associated Universities Inc., Washington, D.C.

Return to AIPS++ Home Page
2006-10-15