PDA

View Full Version : QScript + get function call parameters



Fastman
28th July 2009, 12:45
Can I still serve to get the number of parameters that function accepts ?

for example, have a few f-tions



cScript4 += _T("function MsToTm(a1){ ..some logic}");
cScript4 += _T("function TmToMs(a1, a2){ ..some logic}");


Is there a way to get the number of parameters for each of the functions.

wysota
28th July 2009, 20:27
From within the function or from outside of it? If the latter, there is no such possibility as in JavaScript you can always pass any parameters to any function and it's the function itself that has to validate them.

Fastman
1st August 2009, 11:28
From within the function or from outside of it? If the latter, there is no such possibility as in JavaScript you can always pass any parameters to any function and it's the function itself that has to validate them.

Thx.
yes .. you are certainly right. Just would like to check for example the number and type of parameter passed before execute the script.
:)

wysota
1st August 2009, 15:30
You can parse the input manually and count the parameters passed.