Jump to content

Unable to evaluate expression - basic if condition


Recommended Posts

Hello everyone,


I get this expression error but I can't figure why.

Can someone please tell what i'm doing wrong ? Or maybe it's not possible to do that in this field ?




Thank you,



Link to comment
Share on other sites

There is parentheses mismatch in the original expression, which will break any code.

If you want to use classic C-like if (cond) {statement} else {statement}, you need to open full editor via RMB menu and use multi-line expression (it is like a function body without function declaration itself):

    if (ch("../depth") < 5)
        return ch("../depth") * 4 + 1;
        return ch("../depth") * 3 + 1;

What you used is if() expression function. I think it just wraps code above into something that is easier to use inside expressions. Although it evaluates both branches, I doubt if anyone ever had problems with it in practice.

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.

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...