Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

How To Built Constructed Lists Using Unverified Perl in ACBC - Where To Enter The Perl Code?

Hello everybody!

I want to use a preliminary screening question before my ACBC starts. In the Piano Tutorial 2 its pretty good discribed how to do this. Nevertheless I can't figure out where to put the suggested Perl Codes??? Thx!

Thats what the Tutorial says:

To build ScreenedInPianoBrands, you select Q1PianoBrands as the parent list, and you use the following list-building logic:

 AIC (Q1, 1, 15)  
 
  

Create a constructed list named PianoBrandsForACBC (select PianoBrands as the parent list). Insert the following constructed list logic (only two things need to be modified in this sample code, the list names that are underlined):

 begin unverified perl  
 
  
 #This code will map the results from one list to another one. Both lists need to be in the same order, starting with item 1.  
 
  
 
 #Note: Both parent lists need to be the same length and have corresponding items that match 1 to 1.  
 
  
 
 #The list that you want to "mirror."  This is the list that contains the text for items respondents screened in.  
 
  
 my $strList1Name = "ScreenedInPianoBrands";  
 
  
 
  
 #The parent list of the new list that you are creating.  
 
  
 my $strList2Name = "PianoBrands";  
 
  
  
 
 #-----------Do not modify code below-------------------  
 
 my $List1 = eval(LISTVALUESARRAY($strList1Name));  
 
 my $intItem = 0;  
 
 foreach $intItem (@{$List1})  
 
 {  
 
 ADD($strList2Name, $intItem);   
 
 }  
 
 #-----------------------------------------------------  
 
  
 end unverified
asked Oct 2, 2012 by T.K. (330 points)
retagged Oct 2, 2012 by Walter Williams

1 Answer

+1 vote
 
Best answer
Put the perl code in the constructed list logic.  The section titled Constructed List Instructions.
answered Oct 2, 2012 by Mike Lodder Gold (23,410 points)
selected Oct 2, 2012 by T.K.
Exactly thats my problem. What is the constructed list logic? Is it the "Constructed List Instructions" box?
Yes that is correct
Thank you very much!
...