Welcome Guest! Log in


The forum is in read only mode.
The Stambia User Community is moving to Semarchy! All the applicable resources have already been moved or are currently being moved to their new location. Read more…

Topic-icon Question How to split the values of an input parameter with scripting ?

  • Nicolas Verscheure
  • Nicolas Verscheure's Avatar Topic Author
  • Offline
16 Dec 2014 18:07 - 17 Dec 2014 09:32 #1 by Nicolas Verscheure
It's possible to call a delivery with a parameter like that : 'ABC', 'DEF', 'GHI'
Unfortunately, it's not always possible to use the singles quotes especially when you are using a professional scheduler like Visual Tom. Indeed the singles quotes are interpreted by the scheduler.
You can solve it simply using this scripting :

var str = "${~/inListOfValues}$";
var n = str.split(",");
var result = "";
for(var i = 0;i < n.length;i++) {
    if(result != "") result += ",";
    result += "'"+n[i]+"'";
println("inListOfValues = ${~/inListOfValues}$");
println("inListOfValues splitted = " + result);

Result :

Thus you can use the splitted values in a filter in a mapping for example.
Last edit: 17 Dec 2014 09:32 by Nicolas Verscheure.