up
previous
next
Sprint
Syntax
Sprint(E:OBJECT):STRING
Summary
convert to a 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 ::= Q[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