NAME

iprint, sprint - output of integers, characters, and strings

SYNOPSIS

iprint( n )
sprint(
s )

DESCRIPTION

iprint() writes the integer pointed to by n in decimal to the standard output window. Note that Tranquility only has support for integers and will truncate fractional numbers.

sprint() writes the string starting at the address s to the standard output window

RETURN VALUE

iprint() and sprint() do not have return values

ERRORS

The tranqc(1) compiler will produce an "Argument list syntax error" if fractional values with a decimal point are used in iprint(3).

EXAMPLE

Hello world from page 1 of the Tranquility Programmer’s Manual
https://www.cs.drexel.edu/~bls96/tranquility.pdf

fun init() {
     sprint("Hello World")
}

The following example from page 3 of the Tranquility Programmer’s Manual
https://www.cs.drexel.edu/~bls96/tranquility.pdf prints a table of squares from 0 to 9 to standard out.

fun sq( n ) {
     return .n * .n
}

fun init() {
     var i


     sprint("Table of squares:\n")
     i : 1
     loop {
          until .i > 10
          iprint( .i )
          sprint(" squared equals ")
          iprint( sq(.i) )
          nl()
          i : .i + 1
     }
}

AUTHORS

Charlie Stuart cstuart11@protonmail.com
Alex Jacobs, Fall 21-22
Cole Zucosky, Fall 21-22
Mahima Chacko, Fall 21-22

REPORTING BUGS

First, check the Tranquility Programmer’s Manual
https://www.cs.drexel.edu/~bls96/tranquility.pdf
If the problem persists see Dr. Stuart or Charlie Stuart

Dr. Stuart: brian.l.stuart@drexel.edu
Charlie Stuart: cstuart11@protonmail.com

SEE ALSO

iread(3), sread(3), i2s(3)

Tranquility Programmer’s Manual
https://www.cs.drexel.edu/~bls96/tranquility.pdf