What is your input? An array of numbers? A string of numbers separated by a common delimiter?
Whatever the case is, let us suppose you manage to get an array of numbers represented by strings
ie: ["1", "2", "3"] (if they're not strings, you will have to convert them to string when you're concatenating them)
local stringvar array myList := {whatever input};
local stringvar outList := '';
local numbervar tempLen := count(myList)
local numbervar i;
for i := 1 to tempLen - 1 Do
outList := outList & myList & ","
outList := outList & "and " & myList[tempLen]
So given n numbers, you would concatenate your first n - 1 numbers together each followed by a comma + space, and you would treat your last number differently with a preceding "and"
Edited by Keikoku - 14 Mar 2011 at 3:45am