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

[Cheetahtemplate-discuss] searchlist scope inside loop

Expand Messages
  • Tim Arnold
    hi, I seem to be unable to test for nested variables in a searchlist from within a loop: The following snippet loops over the rows, but the if statement always
    Message 1 of 2 , May 13 6:47 AM
      hi,
      I seem to be unable to test for nested variables in a searchlist from
      within a loop: The following snippet loops over the rows, but the if
      statement always false.

      #for $row in $here
      <tr>
      #for $cell in $row
      #if $varExists('cell.isHeader') and $cell.isHeader


      Is it impossible to use $varExists('loopvar.subvar') or is there any
      way to test variables from within a loop?

      thanks,
      --Tim Arnold

      ------------------------------------------------------------------------------
      Achieve unprecedented app performance and reliability
      What every C/C++ and Fortran developer should know.
      Learn how Intel has extended the reach of its next-generation tools
      to help boost performance applications - inlcuding clusters.
      http://p.sf.net/sfu/intel-dev2devmay
      _______________________________________________
      Cheetahtemplate-discuss mailing list
      Cheetahtemplate-discuss@...
      https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
    • Tim Arnold
      Replying to my own question: The variables *are* available inside the loop, but $varExists doesn t work on them. My conclusion is that the problem lies inside
      Message 2 of 2 , May 19 12:12 PM
        Replying to my own question:

        The variables *are* available inside the loop, but $varExists doesn't
        work on them. My conclusion is that the problem lies inside the
        implementation of the $varExists function.

        just fyi for any future googlers.
        --Tim Arnold



        On Fri, May 13, 2011 at 9:47 AM, Tim Arnold <jtim.arnold@...> wrote:
        > hi,
        > I seem to be unable to test for nested variables in a searchlist from
        > within a loop: The following snippet loops over the rows, but the if
        > statement always false.
        >
        > #for $row in $here
        >  <tr>
        >  #for $cell in $row
        >    #if $varExists('cell.isHeader') and $cell.isHeader
        >
        >
        > Is it impossible to use $varExists('loopvar.subvar') or is there any
        > way to test variables from within a loop?
        >
        > thanks,
        > --Tim Arnold
        >

        ------------------------------------------------------------------------------
        What Every C/C++ and Fortran developer Should Know!
        Read this article and learn how Intel has extended the reach of its
        next-generation tools to help Windows* and Linux* C/C++ and Fortran
        developers boost performance applications - including clusters.
        http://p.sf.net/sfu/intel-dev2devmay
        _______________________________________________
        Cheetahtemplate-discuss mailing list
        Cheetahtemplate-discuss@...
        https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
      Your message has been successfully submitted and would be delivered to recipients shortly.