function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
JJamesJJames 

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;
else
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?