Game Development Community

Quotes around datablock name necessary?

by Rob Segal · in Torque Game Engine · 02/19/2006 (12:52 pm) · 2 replies

If I delcare an object as follows...

$myObj = new StaticShape()
{
dataBlock = MyFirstDataBlock;
};

is there any difference between declaring the same instance as...

$myObj = new StaticShape()
{
dataBlock = "MyFirstDataBlock";
};

With quotes around the data block name. They seem to do the same thing but I thought I would inquire if there is any notable difference. If it is the same thing I would imagine the quotes would be used for datablock names with spaces perhaps?

#1
02/19/2006 (12:59 pm)
Well... I don't think you can make datablock names with spaces, and in any case shouldn't be. I think the thing with quotes is just because all data in script is interpreted as string data, so you can give anything a value like that. You could give numerical values as "1.5" and such if you wanted too.
#2
02/19/2006 (8:49 pm)
I guess I could see that. It confused me at first seeing functions which would take a tuple as a string with spaces. Say like setTransform which I believe takes a 3-tuple as it's parameter "1 1 1" styles. Anyways I'm pretty sure there isn't a difference between the two.