GoSub>Join,"Array Name",delimiter,Ending delimiter 0/1,"Result Variable"
Both the array and the result variable names need to be in quotation marks.
(Not sure if this is an overkill to solve it. Please share if there is a better way to solve it that covers all arrays).
(Technical. When trying different versions of it I noted that, if I change ArrayCount>Join_Arr_1,Join_Arr_Count to ArrayCount>%Join_Arr_1%,Join_Arr_Count then MS is crashing for me).
Code: Select all
Let>Test=Here is a new list with numbers 83 465 53 24 4533 19 22 5
Let>delimiter=,
RegEx>\d+,Test,0,M,NM,0
Gosub>Join,"M",delimiter,0,"result"
MessageModal>result
//SRT Join,"Array Name",delimiter,ending delimiter 0/1,"Result Variable Name"
SRT>Join
//Get the Array name w/o "" into Join_Arr_1
RegEx>(?<=^").+(?="$),%Join_Var_1%,0,Join_Arr,Join_N,0
ArrayCount>Join_Arr_1,Join_Arr_Count
Let>Join_delimiter=%Join_Var_2%
Let>Join_Res=
Let>Join_ct=0
While>Join_ct<Join_Arr_Count
Let>Join_ct=%Join_ct%+1
Let>Join_tmp=%Join_Arr_1%_%Join_ct%
Let>Join_Res=%Join_Res%%Join_tmp%%Join_delimiter%
EndWhile
If>Join_Var_3=0
RegEx>%Join_delimiter%(?=$),Join_Res,0,Matches,NumMatches,1,,Join_Res
Endif
//Get the Result Variable name w/o "" into Join_ResOut_1
RegEx>(?<=^").+(?="$),%Join_var_4%,0,Join_ResOut,N,0
Let>%Join_ResOut_1%=%Join_Res%
END>Join