andmotion Posted August 7, 2019 Share Posted August 7, 2019 Hi there, As I am on vex learning path you know many silly questions coming up every day. I think this one is one of these:) Is there any different between those two lines? v@a = {0,0,1}; v@a = set(0,0,1); wrangler doesn't telling me anything wrong and the result is the same so I am wondering ---- {} ------ is this type of brackets saying SET? Thanks Quote Link to comment Share on other sites More sharing options...
ikoon Posted August 7, 2019 Share Posted August 7, 2019 Hi Andrzej, those yours two lines are both fine, as long, as you don't use variables or @attributes inside the first method {}. The "advantage" of the set() function is, that you can use variables (or attributes) as an argument: float x = 0; @y = 0; // next line contains error: v@a = {x, @y, 1}; // next line is correct: v@a = set(x, @y, 1); Quote Link to comment Share on other sites More sharing options...
andmotion Posted August 7, 2019 Author Share Posted August 7, 2019 7 minutes ago, ikoon said: Hi Andrzej, those yours two lines are both fine, as long, as you don't use variables or @attributes inside the first method {}. The "advantage" of the set() function is, that you can use variables (or attributes) as an argument: float x = 0; @y = 0; // next line contains error: v@a = {x, @y, 1}; // next line is correct: v@a = set(x, @y, 1); Thanks ikoon it makes sense:) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.