Game Development Community

Pass a parameter in command?

by Dumbledore · in Torque Game Engine · 06/12/2008 (5:40 pm) · 1 replies

GuiBitmapButtonCtrl 
{
    command = "someFunc(needsAParam)";
}

This doesn't work. Parse Error. I have explored the variable field, but I'm not sure if it can be used to give an arbitrary value like "hello". If I made variable = $global, and set $global = "hello", then I could call someFunc() and inside someFunc() I could extract "hello".

If you are pretty sure there is no way to do it, please tell me so I don't waste any more time on this. I've been reading the engine source but the code gets EXTREMELY weird around this area so I can't interpret it for a solution.

#1
06/12/2008 (6:02 pm)
Try adding a semicolon to the command:

command = "someFunc(needsAParam);";