Syntax highlight for EViews, the if condition (not if block)

Max Chen
2013-06-28
2013-06-29
  • Loreia2

    Loreia2 - 2013-06-28

    Hi Max Chen,

    what is the problem with that picture? You have two "if" statements and both are picked as folding points, exactly as specified in userdefine.xml file.

    What are you trying to achieve?

    BR,
    Loreia

     
  • Max Chen

    Max Chen - 2013-06-28

    Hi,
    In EViews, there is "if else endif" for branching, say block if statement. However, ther is "if condition", like the two lines in the screenshot. They are not blocks of if statement, and do not need to fold. How to configure in this situation?

    As for if statements, the line must begin with keyword "if" (or only spaces of tab before IF). And for IF condition, it is part of a sentence, provide information for commands like smpl, pagecontract, etc.

    Thanks

     
    Last edit: Max Chen 2013-06-28
  • Loreia2

    Loreia2 - 2013-06-28

    Hi Max Chen,

    this is too much for UDL2 to chew. You just can't select position if fold statement.

    Good news is that the upcoming UDL3 will address this issue, but don't expect it anytime soon.

    The semisolution would be to define closing "Folding in comment" keyword, say "END" and to rewrite your code like this:

    ~~~~~~~~~~~~~~~~~~~~~~~~~
    smpl if x > 0 and y < 0 ' END
    ~~~~~~~~~~~~~~~~~~~~~~~

    BR,
    Loreia

     
  • Max Chen

    Max Chen - 2013-06-29

    thanks so much! Now I using "Folding in comment" (close by " '. ")

    smpl if x > 0 and y < 0 '.