I am new to AMP, and currently trying the following with for:
set @len = indexOf ([listofemails],';') if @len > 0 then for @part = indexof([listofemails],';') to 0 do @remainder = Add (@remainder,@ONE) /* script to update listofemails here*/ next @part endif
So basically I want to check how many sub-strings exist separated by semicolon, and use that value later. Right now my for statement is not executing at all, seems to be having some issue. Can somebody help me out.
Thanks to @Gortonington for the answer - it was indeed the issue with downto instead of to.
However I realized there is an easier way to do the thing I was looking for using the for loop.
set @len = indexOf ([listofemails],';') if @len > 0 then set @parts = BuildRowsetFromString ([listofemails],';') for @counter = 1 to RowCount(@parts) do set @part = row (@parts,@counter) next @counter endif