0 votes
in SoSci Survey (English) by s257376 (140 points)
reopened by SoSci Survey

Dear support team,

I am getting the error message "There are not enough parameters for the function replace(). 2 parameters are essential for proper processing. Please refer to the user manual for further details." However, I have included 2 parameters and I followed the exact same structure that I have used in previous surveys. Also, if I try often enough, the error message sometimes disappears and the question is shown as desired.

The code I use that includes "replace" is:


$Attr1A = array(
1 => 'public transportation',
2 => 'private transportation',
3 => 'walking / cycling',
4 => 'public transportation',
5 => 'walking / cycling',
6 => 'walking / cycling',
7 => 'public transportation',
8 => 'private transportation',
9 => 'public transportation',
10 => 'private transportation',
11 => 'walking / cycling',
12 => 'public transportation',
);

$code = value('DC07');
$OneA = $Attr1A[$code];
replace ('%Attr1A%', $OneA);


This is part of a discrete choice experiment.

I appreciate your help!

2 Answers

0 votes
by SoSci Survey (327k points)

Is that the only message or is there another warning on the page?

What does the debug information on this page say?

My assumption is this: value('DC07') resturn something that is not 1 to 12. For example -1 oder 13. Then $Attr1A[$code] cannot return anything, that is $OneA has the value NULL.

And then replace ('%Attr1A%', $OneA) says that it's not lucky with having NULL (that is "no parameter") as second parameter.

by s257376 (140 points)
Thank you for the quick reply! That was indeed the mistake, I hadn't updated the values for DC07. It works now. Thank you!
0 votes
by s257376 (140 points)

Actually, a similar issue remains and I don't understand why. It's only on the third page (so the third choice of the discrete choice experiment), while the code is exactly the same on the previous two pages. This is the error message:

Willkommen im Online-Support von SoSci Survey.

Hier bekommen Sie schnelle und fundierte Antworten von anderen Projektleitern und direkt von SoSci Survey.

→ Eine Frage stellen


Welcome to the SoSci Survey online support.

Simply ask a question to quickly get answers from other professionals, and directly from SoSci Survey.

→ Ask a Question

...