evanrudefx Posted August 25, 2017 Share Posted August 25, 2017 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 (condition) statement_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 Quote Link to comment Share on other sites More sharing options...
Atom Posted August 25, 2017 Share Posted August 25, 2017 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. 2 Quote Link to comment Share on other sites More sharing options...
evanrudefx Posted August 25, 2017 Author Share Posted August 25, 2017 I wasn't sure if I was just ignorant of if it is actually confusing. 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.