Announcement

Collapse
No announcement yet.

If statement

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • If statement

    Just a quick one,

    If I code an if statement and want two things to happen, how do i write it?
    This gives me an error:

    if( r1 >= 0) {r1b = r1 && r1s = 0};

    does this make sense:

    if( r1 >= 0) {r1b = r1 , r1s = 0}; ?

    Thank you in advance.

  • #2
    Re: If statement

    DolmenProp
    If you need to execute more than one item you need to enclose them in curly brackets (aka braces) and separate them either with a semi-colon or a comma eg
    if(...) {
    do this;
    do that;
    }

    See also section 2.3.3 of the Beginner Tutorial 2: Commonly Used Core JavaScript which is in the Help Guides and Tutorials folder of the EFS KnowledgeBase
    Alex


    Originally posted by DolmenProp
    Just a quick one,

    If I code an if statement and want two things to happen, how do i write it?
    This gives me an error:

    if( r1 >= 0) {r1b = r1 && r1s = 0};

    does this make sense:

    if( r1 >= 0) {r1b = r1 , r1s = 0}; ?

    Thank you in advance.

    Comment

    Working...
    X