Loading ...
Sorry, an error occurred while loading the content.
 

[Clip] Problem with If.....ELSE

Expand Messages
  • vermaire@worldonline.nl
    Hi there, since a few day s I m using the trial version of Note Tab Pro version 4.6a. I m having some problems with If....ELSE, I would like to know what I m
    Message 1 of 2 , Oct 8, 1999
      Hi there,

      since a few day's I'm using the trial version of Note Tab Pro version
      4.6a.
      I'm having some problems with If....ELSE, I would like to know what I'm
      doing wrong. Below is the code that I've written.

      ^!Set %avar%=^$GetWord$

      ;!IfSame ^%avar% word a ELSE b
      ^!IfSame "^%avar%" "word" a ELSE b
      ;!If ^%avar% = word a ELSE b
      ;!If "^%avar%" = "word" a ELSE b
      :a
      ^!Prompt "^%avar% is the right one"
      :b
      ^!Prompt "Sorry ^%avar% is the wrong one"

      It works fine when the condition does not match the word, and the
      if-statement will execute the label b, but when the condition is true,
      for some reason both labels (a and b) are executed. Could you tell me
      which If-statement I should use, or are they disabeled because I use
      the trial version?

      With regards,
      Erik-jan Vermaire
    • Jody
      Hi Erik-jan, ... ^!IfSame ^%avar% word a ELSE b ... ^!Prompt ^%avar% is the right one ^!Goto End ... ^!Prompt Sorry ^%avar% is the wrong one ... You
      Message 2 of 2 , Oct 8, 1999
        Hi Erik-jan,

        > I'm having some problems with If....ELSE, I would like to know
        > what I'm doing wrong. Below is the code that I've written.

        ^!IfSame "^%avar%" "word" a ELSE b
        :a
        ^!Prompt "^%avar% is the right one"
        ^!Goto End
        :b
        ^!Prompt "Sorry ^%avar% is the wrong one"

        > It works fine when the condition does not match the word, and
        > the if-statement will execute the label b, but when the
        > condition is true, for some reason both labels (a and b) are
        > executed.

        You did not tell it to skip the :b if the statement was true
        somehow. I used Goto End, but it could be to a label beyond :b,
        or Skip_2

        ^!If Integer1 <>= Integer2 GoToLabelTrue [ELSE GoToLabelFalse]
        ^!If "String1" <>= "String2" GoToLabelTrue [ELSE GoToLabelFalse]

        Compares numbers or text strings, but use quotes with the
        strings. Quotes can also be used with a number.

        ^!If[Diff/Same] "Value1" "Value2" GoToLabelTrue [ELSE GoToLabelFalse]

        Compares two string values. Notice the quotes must be there.

        Happy Clip'n!
        Jody

        http://www.sureword.com/notetab

        The NoteTab Clip List...
        mailto:Ntb-Clips-Subscribe@...
        mailto:Ntb-Clips-UnSubscribe@...
      Your message has been successfully submitted and would be delivered to recipients shortly.