Below is an example. Create function (parsePaste in example) to handle the input and do modifications you want to: remove duplicates, replace row changes with something, remove duplicated separators... After pressing OK this will return one string, then you can modify the returned string to fit in to your SQL (Words() and Concat Items() as examples).
Names Default To Here(1);
parsePaste = function({tempStr}, {Default Local},
tempStr = Regex(tempStr, "\r\n", ",", GLOBALREPLACE); //replace row changes with ,
tempStr = Substitute(tempStr, ",,", ","); //replace double ,, with one ,
tempStr = Regex(tempStr, ",$", "", GLOBALREPLACE); //remove , if last character
return(tempStr);
);
win2 = New Window("Example", << Modal,
V List Box(
Text Box("Add Serialnumbers:"),
teb = Text Edit Box("", << set width(200), << set nlines(3),
<< Set Function(Function({this},
this << set text(parsePaste(this << get text));
))
),
H List Box(
Button Box("OK", listStr = teb << get text),
Button Box("Cancel")
)
)
);
show(listStr);
temp = Words(listStr, ",");
temp = "'" || Concat Items(temp, "','") ||"'";
show(temp);
-Jarmo