I have a global variable called @Count
. I also have a for loop that increases the @Count
by 1 each time I cycle through the loop. Is there a way for me to detect with AMPScript whether @Count
is an odd or even number?
%%[ /* SET GLOBAL COUNT VARIABLE */ SET @Count = 0 /* INCREASE THE COUNT BY 1 EACH TIME */ FOR @i = 1 TO @increaseCount DO SET @Count = Add(@Count,1) NEXT @i /* DO SOMETHING IF COUNT IS EVEN OR ODD NUMBER */ IF @Count == "even" THEN BLANK ELSEIF @Count == "odd" THEN BLANK ENDIF ]%%