Menu

BUG {IF} INSIDE {IF}

2005-11-03
2013-04-02
  • Tetsuo Akira

    Tetsuo Akira - 2005-11-03

    I am testing iCode, I like it a lot, but I am having a bug with this code:
    SELECT
                {TABLE.COLUMNS NOPRIMARY}
                    {IF COLUMN.TYPE NE 'DATETIME'} {COLUMN.NAME} {IF NOT LAST} , {/IF} {/IF}
                {/TABLE.COLUMNS}

    The output is:
    SELECT
                 id , 
                 descricao , 
                 user_change , 
                {/IF}
                 ativo_inativo

    Any ideas?

     
    • Alan Juden

      Alan Juden - 2005-11-03

      On this line:
      {IF COLUMN.TYPE NE 'DATETIME'} {COLUMN.NAME} {IF NOT LAST} , {/IF} {/IF}
      You have one to many {/IF} statements at the very end.  Remove one, and you should be set.

       
      • Tetsuo Akira

        Tetsuo Akira - 2005-11-03

        I think it does not parse a TAG inside another...

         
    • Alan Juden

      Alan Juden - 2005-11-03

      Oops, I just saw that you do have 2 {IF} statements...sorry.

       
    • Victor Y. Dominguez

      Right now it doesn't support nested if
      A work around is to separate the ifs, like this:

      {TABLE.COLUMNS NOPRIMARY}
      {IF COLUMN.TYPE NE 'DATETIME'}{COLUMN.NAME}  {/IF}{IF NOT LAST} , {/IF}
      {/TABLE.COLUMNS}

       
      • Victor Y. Dominguez

        Ups, late but I saw what you want to do, let me work on that, and find a solution to have nested if's.

        Thanks.

        V

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.