Get number of parameters

For questions about using Classic.

Post » Fri May 13, 2011 3:58 am

Is there a way to retrieve the number of parameters passed to a function? I use a function to which I pass a variable number of parameters and I'd like to know how many I passed so I can loop through all of them.

I understand that I can do this by simply using a global variable to keep track, but I was wondering if there was an expression that stores this value. Thanks.
B
11
S
2
G
3
Posts: 283
Reputation: 1,968

Post » Sat May 14, 2011 7:35 pm

The function object has a expression for that.
Try Function.NumParams
B
79
S
24
G
54
Posts: 4,747
Reputation: 40,757

Post » Sat May 14, 2011 9:33 pm

Ah thanks i'll try it. Could not find it on the wiki.
B
11
S
2
G
3
Posts: 283
Reputation: 1,968


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests