Hi everyone,
I have a survey where respondents are asked to enter their store number. The retail network has over 2000 stores. I want to validate whether the respondent enters an existing store number or not.
The valid store numbers are listed in a list called "Filialen". They can consist of 1 to 4 digits.
Participants enter the store number in the question "ID1".
I'm using this code in a constructed list called "FilialCheck" to loop over the list for verification. If ListLength(FilialCheck)=0, participants are screened out. It works, but very slowly:
Begin Unverified Perl
my $i=1;
my $filiale = VALUE("ID1");
for($i=1; $i<=LISTLENGTH("Filialen"); $i++)
{
if ($filiale eq LISTLABEL("Filialen",$i))
{
ADD("Filialen",$i);
last;
}
}
End Unverified
Is there a way to make the code run faster?