up previous next
sprint

convert to a string

Syntax
sprint(E: OBJECT): STRING

Description
This function takes any CoCoA expression and converts its value to a string. One use is to check for extremely long output before printing in a CoCoA window.

Example
/**/  use R ::= QQ[x,y];
/**/  I := ideal(x,y);
/**/  J := sprint(I);
/**/  I;
ideal(x, y)

/**/  J;        -- The output for I and J looks the same, but ...
ideal(x, y)

/**/  type(I);  -- I is an ideal, and
IDEAL

/**/  type(J);  -- J is just the string "ideal(x, y)".
STRING

/**/  J[1];  -- the 1st character of J
i

/**/  J[2];  -- the 2nd character of J
d

/**/  len(J);  -- J has 11 characters
11

See Also