[suggestion] Function and parameters

Discussion and feedback on Construct 2

Post » Fri Jul 12, 2013 8:30 pm

I like to use functions. I also like to make them independent of global variables. Hence I use parameters. However, the current system with functions is primitive and highly confusing when you are dealing with up to 3 parameters only distinguishable by their number.

Would it be possible to map the parameters to local variables?

I am doing this manually now but it makes my code look messy and I am not 100% sure what the order of execution is.

I would suggest that during function construction you could set up the expected parameter variables and their type. Then the function would automatically assign those parameters to the variables which then act as local variables.

That would make functions even more powerful and reusable.

B
37
S
9
G
5
Posts: 437
Reputation: 6,094

Post » Fri Jul 12, 2013 9:43 pm

I agree that being able to have named paramaters would make it easier. I don't see it being more powerful.

Though I would love to see instead functions being able to be called without the the Function.Call("") requirement. But instead be used like a nomral function. so instead of

Function.Call("myfoo", "blah")
to
myfoo("blah)

B
90
S
18
G
9
Posts: 2,455
Reputation: 15,018


Return to Construct 2 General

Who is online

Users browsing this forum: jobel and 6 guests