here is a short example:
(you can copy-paste it into a SCRI object.
:SET &SEPERATOR# = ";"
:SET &RECIPIENTSLIST# = "
user@local.com;
mister@local.com;
hero@local.com"
:DEFINE &ARR_RECIPIENTS#, STRING, 10
!FILL splits the string and fills the ARRAY - so no need for a loop!
:FILL &ARR_RECIPIENTS#[] = STR_SPLIT(&RECIPIENTSLIST#,"&SEPERATOR#")
:SET &ARR_RECIPIENTS_LEN# = length(&ARR_RECIPIENTS#[],"SIZE")
:SET &ARR_RECIPIENTS_LEN# = FORMAT(&ARR_RECIPIENTS_LEN#)
!only one loop is needed to get all values from the ARRAY and
!do something with it.
:SET &COUNTA# = 1
:SET &COUNTA# = FORMAT(&COUNTA#)
!loop over whole Array
:WHILE &COUNTA# <= &ARR_RECIPIENTS_LEN#
: P "mailaddress: &ARR_RECIPIENTS#[&COUNTA#]"
: SET &COUNTA# = ADD(&COUNTA#,1)
: SET &COUNTA# = FORMAT(&COUNTA#)
:ENDWHILE
Report:
2016-10-20 09:10:56 - U00020408 mailaddress:
user@local.com2016-10-20 09:10:56 - U00020408 mailaddress:
mister@local.com2016-10-20 09:10:56 - U00020408 mailaddress:
hero@local.com