0 Favourites

Else section always work

  • Hello everybody,

    I am new to Construct 2.

    I have tried to program a Fibonacci function.

    It works quiet well, but I have a general problem with the else section.

    It seems that even when the if condition is true, the else section is

    being execute as well.

    <img src="http://dev.linux.ort.org.il/c2/Pics/Fibo1.png" border="0" />

    <img src="http://dev.linux.ort.org.il/c2/Pics/Fibo2.png" border="0" />

    (This is where the answer should have been 1, not 2!!!)

    <img src="http://dev.linux.ort.org.il/c2/Pics/Fibo3.png" border="0" />

    Can anyone tell me what i am doing wrong ?

    Thank you in advance

    Eylon

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • Hi everyone,

    I found the problem.

    The two conditions: Parameter 0 = 1 -or- Parameter 0 = 2

    should have been: Parameter 0 = "1" -or- Parameter 0 = "2"

    because the parameter comes from a text box as a string!

    It is interesting to see that the condition: Parameter 0 <= 10

    do work, even when the same parameter also comes from a text box as a string.

    Eylon

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)