I think I found a couple of bugs managing the arrays. But if I misunderstood something, please advice.
If in a script task I write the following:
$testList = list();
$testList = list('aaa','bbb','ccc');
$testListTxt = array\join($testList, ",");
$testListTotal = string\length($testList);
I would expect the following values
$testListTxt: aaa,bbb,ccc And that is what I obtained. OK
$testListTotal; 3 But I obtain 5!!! This if the first bug
Then if I add the following code
$testToFind1 ='ccc';
$testToFindIndex1 = array\indexOf($testList, $testToFind1);
ifThenElse($testToFindIndex1 == null,
$testOutput1 = 'Not Found',
$testOutput1 = 'Found');
Both values resulted as expected. OK
$testToFindIndex1: 2
$testOutput1: Found
But if I do the same with a nonexistent value :
$testToFind2 ='abc';
$testToFindIndex2 = array\indexOf($testList, $testToFind2);
ifThenElse($testToFindIndex2 == null,
$testOutput2 = 'Not Found',
$testOutput2 = 'Found');
Result values are not as expected.
$testToFindIndex1: Seems correct as I was expecting null, but something different was obtained looking at the next value, so this is the second bug.
$testOutput1: Found Here I was expecting 'Not Found'
If in a script task I write the following:
$testList = list();
$testList = list('aaa','bbb','ccc');
$testListTxt = array\join($testList, ",");
$testListTotal = string\length($testList);
I would expect the following values
$testListTxt: aaa,bbb,ccc And that is what I obtained. OK
$testListTotal; 3 But I obtain 5!!! This if the first bug
Then if I add the following code
$testToFind1 ='ccc';
$testToFindIndex1 = array\indexOf($testList, $testToFind1);
ifThenElse($testToFindIndex1 == null,
$testOutput1 = 'Not Found',
$testOutput1 = 'Found');
Both values resulted as expected. OK
$testToFindIndex1: 2
$testOutput1: Found
But if I do the same with a nonexistent value :
$testToFind2 ='abc';
$testToFindIndex2 = array\indexOf($testList, $testToFind2);
ifThenElse($testToFindIndex2 == null,
$testOutput2 = 'Not Found',
$testOutput2 = 'Found');
Result values are not as expected.
$testToFindIndex1: Seems correct as I was expecting null, but something different was obtained looking at the next value, so this is the second bug.
$testOutput1: Found Here I was expecting 'Not Found'
Comment