print
 
 
 

Displays text in the Script Editor. You can use this function to display the contents of attributes and variables. This is helpful for debugging an expression.

print(string text)

print(vector number)

print(float number)

print(int number)

print(array number)

text is either a string enclosed in quote marks or an attribute name or string variable containing text.

number is a number without the quote marks. Numerical arguments display as strings.

There is no returned value for this function.

Note the following display considerations.

1.518876356 0 -1.290387446
"text1" + "text2"

This is displayed as:

text1text2
"text" + 1

This is displayed as:

text1

Examples

print(time);
print("\n");

The first statement displays the value of time. The second statement displays a new-line character after the value of time, so the time appears on a separate line in the Script Editor.

float $f = 3.14159;
print($f);

Displays the floating point number 3.14159.

string $s = "Hello There";
print($s);

Displays the string Hello There.

vector $v;
$v = <<1.2,2.3,3.4>>;
print($v);

Displays the vector as 1.2 2.3 3.4.

string $a[];
$a = eval("ls -lights");
print($a+" are the lights in my scene.\n");

The print function causes an error message because you cannot use the + operator with a string array.