Hi.
When it doesn't find the value in the array it is not returning null. Is returning something else.
To test this I wrote this script
$testList = list(1,2,3,4,5,6);
$verify = 9;
$position = array\indexOf($testList, $verify);
$answer = 'unanswered';
ifThen($position > 0,
$answer = '>0');
ifThen($position == 0,
$answer = '0');
ifThen($position == null,
$answer = 'null');
ifThen($position == '',
$answer = 'nothing');
//********** INICIO LOG DE PRUEBAS
$tstDescription = null;
$tstName = "Test 1 ";
$tstDescription = string\concatenate(
' $position ', $position ,
' $verify ', $verify ,
' $answer ', $answer ,
' $testList ', array\join($testList, '-') ,
" ");
$tstLogId = record\create('LogPruebas',
'name', $tstName,
'description', $tstDescription);
//*********** FIN LOG DE PRUEBAS
I ran this script changing the line with the verify line to
$verify = 1;
$verify = 3;
$verify = 9;
And he output was:
So when $verify = 9; ir shows $position apparentely as a null, but when I ask if $position == null, it doesn't make $answer = 'null'
When it doesn't find the value in the array it is not returning null. Is returning something else.
To test this I wrote this script
$testList = list(1,2,3,4,5,6);
$verify = 9;
$position = array\indexOf($testList, $verify);
$answer = 'unanswered';
ifThen($position > 0,
$answer = '>0');
ifThen($position == 0,
$answer = '0');
ifThen($position == null,
$answer = 'null');
ifThen($position == '',
$answer = 'nothing');
//********** INICIO LOG DE PRUEBAS
$tstDescription = null;
$tstName = "Test 1 ";
$tstDescription = string\concatenate(
' $position ', $position ,
' $verify ', $verify ,
' $answer ', $answer ,
' $testList ', array\join($testList, '-') ,
" ");
$tstLogId = record\create('LogPruebas',
'name', $tstName,
'description', $tstDescription);
//*********** FIN LOG DE PRUEBAS
I ran this script changing the line with the verify line to
$verify = 1;
$verify = 3;
$verify = 9;
And he output was:
So when $verify = 9; ir shows $position apparentely as a null, but when I ask if $position == null, it doesn't make $answer = 'null'
Comment