Jump to content

Vex bracket thought


andmotion

Recommended Posts

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

Link to comment
Share on other sites

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);

 

Link to comment
Share on other sites

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:)

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...