Function Parameters

For questions about using Classic.

Post » Sat Oct 22, 2011 5:05 am

I was wondering if it is possible to keep function parameters separated. I'm trying to call Function A from a couple of functions (say, Func B and Func C) which take different number or arguments, making it hard to use argument number for Function A. So like if Function B takes 2 arguments and Function C takes 3 arguments, if both of those can call Function A, then I'm not sure how I could make use of arguments in Function A. I can't just clear them because Functions B and C need their arguments after Function A is done.

Is there a straightforward non-convoluted way to do this or is the best solution to use globals?
B
11
S
2
G
3
Posts: 283
Reputation: 1,968

Post » Sat Oct 22, 2011 7:31 am

I'm not sure if it is a bug or a feature, but every function call gets its seperate parameter list, if you call it from within another function. You still need globals (or privates) but only as a buffer for every return value within another function, it really isn't confusing and you keep overview.

Here is an example that might make it clearer than my words:
http://www.mediafire.com/file/5q8zqatb3yo7abe/multiplefunctioncalls.cap
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 9 guests