Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Set variable according to text/line and not link.

This is what I'm working with:
[[Hey.|Punch][set $X to 0]]
[[Hello.|Punch][set $X to 1]]
Which takes us to:
<<if $X eq 0>>Get punched!<<endif>>
<<if$X eq 1>>Get kissed!<<endif>>
Trouble is the variable always stays at 0. The first line is always displayed.

Am I doing something wrong? How can I solve this?


Comments

  • Remove the erroneous "set" from the setter portion of the link, it doesn't belong.  For example:

    [[Hey.|Punch][$X to 0]]
    [[Hello.|Punch][$X to 1]]
    You can also clean up your &lt;&lt;if&gt;&gt; macro usage, especially if $X will only have two states.  For example:

    /% Two-states %/
    <<if $X is 0>>Get punched!<<else>>Get kissed!<<endif>>

    /% Three-states %/
    <<if $X is 0>>Get punched!\
    <<elseif $X is 1>>Get slapped!\
    <<else>>Get kissed!\
    <<endif>>
  • TheMadExile wrote:

    Remove the erroneous "set" from the setter portion of the link, it doesn't belong.  For example:

    [[Hey.|Punch][$X to 0]]
    [[Hello.|Punch][$X to 1]]
    You can also clean up your &lt;&lt;if&gt;&gt; macro usage, especially if $X will only have two states.  For example:

    /% Two-states %/
    <<if $X is 0>>Get punched!<<else>>Get kissed!<<endif>>

    /% Three-states %/
    <<if $X is 0>>Get punched!\
    <<elseif $X is 1>>Get slapped!\
    <<else>>Get kissed!\
    <<endif>>


    BOOM. Thank you very much. :D
Sign In or Register to comment.