4 Replies Latest reply: Jul 4, 2014 2:45 PM by Christian Farley RSS

    Looping through a crosstable

      Hi All.

       

      Is there something special about looping though a crosstab? I am getting very odd results with the following approach.

       

      FOR  vRowCounter = 1 TO NoOfRows('MasterScoreXTAB')

           LET vField1  = FieldValue('Field A',vRowCounter);

       

           LET vField2  = FieldValue('Field B',vRowCounter);

           LET vField3  = FieldValue('Field C',vRowCounter);

       

       

           Trace =====> $(vField1) ++ $(vField2) ++$(vField3)

      NEXT

       

      With this construct I am expecting to see each fields of the Crosstab row side-by-side. But $(vField2) is showing values from a different row in the crosstab, as if vRowCounter was being incremented several times within a single loop cycle.

       

      Any hint?