Jump to content

Understanding Vex documentation


Recommended Posts

Hey,

I have been reading the houdini manual section on vex. I must be understanding the documentation incorrectly. For instance, here is the syntax in the documentation for "if" statement:

if (conditionstatement_if_true [else statement_if_false

What I don't understand is that syntax doesn't work.

If I write: if (@id < 60) force.y = 20 [else force.y = -20]; 

that does't actually work. I must write this:

if (@id < 60) force.y = 20;
else (force.y = -10);

Writing it that way works. Why would it show the syntax the other way if it doesn't work?
Thanks

Link to comment
Share on other sites

This is at the top of the help page.

 {}

As in C and many other languages, you can enclose multiple statements inside curly braces to act as a block.

The bracket just means the statement is optional.

A lot of languages are based upon the syntax found in the original C programming language book. Pick it up at a used book store or online.

https://en.wikipedia.org/wiki/The_C_Programming_Language

 

Meanwhile, report the documentation confusion to support@sidefx.com.

 

  • Like 2
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...