Game Development Community

possible bug in setWord(...);

by Thomas Bang · in Torque Game Engine · 05/21/2009 (3:23 am) · 4 replies

In TGE 1.5.2 i tried this (Console):

$text = "I love coffee";
echo($text);

Output is: I love coffee

Now type:
setWord($text, 2, "tea");
echo($text);

Output is: I love coffee

But it should be "I love tea"


Any suggestions?


#1
05/21/2009 (3:25 am)
You should use
$text = setWord($text, 2, "tea");
#2
05/21/2009 (3:30 am)
I am so stupid... thanks.
#3
05/21/2009 (9:11 am)
The function name is not exactly intuitive then, replaceWord or something would make more sense :-)
#4
05/21/2009 (9:30 am)
TorqueScript does not have references :P...