Game Development Community

Can I send some parameters to a function using the method call()?

by Oriol "Orgarus" Garcia · in Torque Game Builder · 12/10/2009 (2:21 am) · 5 replies

Hi,

I mean, if I want to execute some function in this way
call("somefunction")

can I send parameters to "somefunction" using the call() method?

something like: call("somefunction","parameter1").

Regards.

#1
12/10/2009 (3:04 am)
Yep, that will work!

I'm assuming that are doing this on an object, like "Bob.call( functionName, 1, 2, "param3");".
#2
12/10/2009 (3:34 am)
and the answer comes from Mr.Lee "eagle-eyed Guardian of the forums" Sims , of course! (I think GG must to put you on payroll, man) :)

Nope, I use the "call" method as follows:

if($grupoDeTareasActual !$= ""){
         call($grupoDeTareasActual);
   }


Thanks for your "quick as ever" answer.

Kind regards!

#3
12/10/2009 (4:33 am)
Silly me! I forgot about the non-object version!

You're very much welcome!
#4
12/10/2009 (12:10 pm)
@Oriol,
You're posts crack me up!

Quote:and the answer comes from Mr.Lee "eagle-eyed Guardian of the forums" Sims , of course! (I think GG must to put you on payroll, man) :),

I love it!