function object

For questions about using Classic.

Post » Sat Dec 12, 2009 3:50 am

viewtopic.php?f=8&t=3068

does it always remember picked objects or how do you set this

and do you always use a text object to set the function
i just want to pass them to the function but dont know what else you should use

my example:

functiontxt set text to Function.setstartvalue(1000,1000,300,1)
B
2
G
3
Posts: 72
Reputation: 994

Post » Sat Dec 12, 2009 5:47 am

There is an option for remember objects. just select yes remember or no dont remember.

I really dont understand what you are talking about in the second question.

When you are calling Function.setstartvalue(1000,1000,300,1)
you are passing it for paramaters. so in your function you would have

on function setStartValue
-set myvar to function.param(1) // this will set my var to 1000 2 would also and 3 would set it to 300.

you could also pass it variables by doing function.MyFunction( myObject('myVar'))
B
5
S
2
G
4
Posts: 632
Reputation: 2,829

Post » Sat Dec 12, 2009 6:01 am

[quote="Aeal5566":1ur34azm]There is an option for remember objects. just select yes remember or no dont remember.[/quote:1ur34azm]

I think he means does calling a function from an expression remember picked objects. Which is a good question because, well, you're calling it from an expression and there's no drop-down menu to select Remember or Forget from.

And... I don't know the answer :P
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Sat Dec 12, 2009 7:29 am

As far as I can tell, calling a function through an expression remembers object picking.

However, if I'm wrong(which I'm fairly certain I'm not, since I tested it), you could always use the "Add parameter" action for your parameters and call your functions using the "Call function" action to ensure proper object picking.
Moderator
B
98
S
37
G
19
Posts: 1,584
Reputation: 17,817

Post » Sat Dec 12, 2009 3:46 pm

okey thanx for the replys,

so in case i would like it set to forget i should use the add param and call function and dropdown

and for using the text , i guess its a good way as i don't need a seperate var for setting the param
or maybe a global var is also a good way

so like this

global('setstart') set var to Function.setstartvalue(1000,1000,300,1)

i guess my question was why do you need to set something, why not just
Function.setstartvalue(1000,1000,300,1)
B
2
G
3
Posts: 72
Reputation: 994

Post » Sat Dec 12, 2009 11:54 pm

[quote="Aphex":nerlx6u9]i guess my question was why do you need to set something, why not just
Function.setstartvalue(1000,1000,300,1)[/quote:nerlx6u9]
Because it is not implemented ;)
If you want to pass parameters to a function without the need of a return value (like in your example set text) you have to set the parameters seperately and then call the function. It is part of the concept - the way of calling a function with a return value directly within the expression is just a shortcut for your convenience :)
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 2 guests