+ Start a Discussion

creating a variable and assigning it in repeat functions

I am having a bit of trouble creating a flag to determine if a line item is in the same group as the item before it.  So I want to create a variable to determine if the item number on a line item is the same as the previous item in the repeat section.  for example
variable itemID = 0;
repeat var = qi{
if(qi.itemID == itemID) indent output text;
itemID = qi.itemID

of course it would be in apex not java but this is what I need to accomplish.  Can i create a variable in the apex or would it be best to have a variable in the controller that holds the value and reassign it?