Currently I have the following CTL script:
Is there a more elegant way of instantiating an empty list besides declaring a dummy variable such as 'emptyList'?
Thanks.
function integer transform() {
string[] emptyList;
string[] myList1 = nvl($in.0.MyList1, emptyList);
string[] myList2 = nvl($in.0.MyList2, emptyList);
string[] myList3 = nvl($in.0.MyList3, emptyList);
string[] myList4 = nvl($in.0.MyList4, emptyList);
string[] myList5 = nvl($in.0.MyList5, emptyList);
return ALL;
}
Is there a more elegant way of instantiating an empty list besides declaring a dummy variable such as 'emptyList'?
Thanks.
-
Hi Mukunku,
there are a handful of other options how to do that (see the attached graph). However, the fundamental question is why you would need to create such a list. As our documentation describes, a list is empty by default. If you could elaborate more on why you consider creating a list with several null values as a must in your use case, I will be glad to discuss it further.
Regards,
Please sign in to leave a comment.
Comments 1