Actions

Translations

ExpressionScript How-tos/19/nl: Difference between revisions

From LimeSurvey Manual

No edit summary
No edit summary
Line 1: Line 1:
</td><td><b>Enkele gebruikelijke fouten, kijk naar de tooltips</b><br>Variabelen gebruiken voor definitie:  <span style="background-color: #eee8aa;"><span title="This variable is not declared until a later page; Not a valid expression" style="border-style: solid; border-width: 2px; border-color: red;"><span title="This variable is not declared until a later page; Not a valid expression; [java61764X3X6][G:3][Q:200]: Wie wint de volgende verkiezingen?; value=?" style="color: #FF00FF ; font-weight: bold">notSetYet</span></span></span><br>Unknown Function:  <span style="background-color: #eee8aa;"><span title="Onbekende functie" style="border-style: solid; border-width: 2px; border-color: red;"><span title="Onbekende functie" style="color: blue; font-weight: bold">iff</span></span>(<span title="[java61764X1X4][G:2][Q:50]: Hoeveel huisdieren heeft u?; value=1" style="color: maroon; font-weight: bold">numPets</span> &gt; <span title="[java61764X1X3][G:2][Q:40]: Hoeveel kinderen heeft u?; value=2" style="color: green; font-weight: bold">numKids</span>,1,2)</span><br>Onbekende variabele: <span style="background-color: #eee8aa;"><span title="Calculate the sum of values in an array; number sum(arg1, arg2, ... argN)" style="color: blue; font-weight: bold">sum</span>(<span title="[java61764X1X2][G:2][Q:30]: Hoe oud bent u?; value=45" style="color: green; font-weight: bold">age</span>,<span title="Onbekende variabele" style="border-style: solid; border-width: 2px; border-color: red;"><span title="Onbekende variabele" style="color: red; font-weight: bold">num_pets</span></span>,<span title="[java61764X1X3][G:2][Q:40]: Hoeveel kinderen heeft u?; value=2" style="color: green; font-weight: bold">numKids</span>)</span><br>Verkeerd aantal parameters: <span style="background-color: #eee8aa;"><span title="Function must have at least 1 argument(s); Not a valid expression" style="border-style: solid; border-width: 2px; border-color: red;"><span title="Function must have at least 1 argument(s); Not a valid expression; Return a formatted string; string sprintf(format, arg1, arg2, ... argN)" style="color: blue; font-weight: bold">sprintf</span></span>()</span>,<span style="background-color: #eee8aa;"><span title="Function does not support that number of arguments:  2.  Function supports this many arguments, where -1=unlimited: 3; Not a valid expression" style="border-style: solid; border-width: 2px; border-color: red;"><span title="Function does not support that number of arguments:  2.  Function supports this many arguments, where -1=unlimited: 3; Not a valid expression; Excel-style if(test,result_if_true,result_if_false); if(test,result_if_true,result_if_false)" style="color: blue; font-weight: bold">if</span></span>(1,2)</span>,<span style="background-color: #eee8aa;"><span title="Function does not support that number of arguments:  0.  Function supports this many arguments, where -1=unlimited: 1,2; Not a valid expression" style="border-style: solid; border-width: 2px; border-color: red;"><span title="Function does not support that number of arguments:  0.  Function supports this many arguments, where -1=unlimited: 1,2; Not a valid expression; Format a local date/time; string date(format [, timestamp=time()])" style="color: blue; font-weight: bold">date</span></span>()</span><br>Read-only variabelen wijzigen:<span style="background-color: #eee8aa;"><span title="The value of this variable can not be changed; Not a valid expression" style="border-style: solid; border-width: 2px; border-color: red;"><span title="The value of this variable can not be changed; Not a valid expression; ; value=worker" style="color: #996600; font-weight: bold">TOKEN:ATTRIBUTE_1</span></span><span title="Assigning a new value to a variable" style="color: red; font-weight: bold">+=</span>10</span>,<span style="background-color: #eee8aa;"><span title="The value of this variable can not be changed; Not a valid expression" style="border-style: solid; border-width: 2px; border-color: red;"><span title="The value of this variable can not be changed; Not a valid expression; [java61764X1X1][G:1][Q:10]: Wat is uw voornaam?; value=Peter" style="color: green; font-weight: bold">name</span></span><span title="Assigning a new value to a variable" style="color: red; font-weight: bold">=</span><span title="" style="color: gray">'Sally'</span></span><br>Unbalanced parentheses: <span style="background-color: #eee8aa;"><span title="Parentheses not balanced" style="border-style: solid; border-width: 2px; border-color: red;"><span title="Parentheses not balanced; Exponential expression; number pow(base, exp)" style="color: blue; font-weight: bold">pow</span></span>(3,4</span>,<span style="background-color: #eee8aa;"><span title="Parentheses not balanced" style="border-style: solid; border-width: 2px; border-color: red;">(</span><span title="Exponential expression; number pow(base, exp)" style="color: blue; font-weight: bold">pow</span>(3,4)</span>,<span style="background-color: #eee8aa;"><span title="Exponential expression; number pow(base, exp)" style="color: blue; font-weight: bold">pow</span>(3,4)<span title="Extra right parentheses detected" style="border-style: solid; border-width: 2px; border-color: red;">)</span></span>
</td><td><b>Enkele gebruikelijke fouten, kijk naar de tooltips</b><br>Variabelen gebruiken voor definitie:  <span style="background-color: #eee8aa;"><span title="This variable is not declared until a later page; Not a valid expression" style="border-style: solid; border-width: 2px; border-color: red;"><span title="This variable is not declared until a later page; Not a valid expression; [java61764X3X6][G:3][Q:200]: Wie wint de volgende verkiezingen?; value=?" style="color: #FF00FF ; font-weight: bold">notSetYet</span></span></span><br>Onbekende functie:  <span style="background-color: #eee8aa;"><span title="Unknown Function" style="border-style: solid; border-width: 2px; border-color: red;"><span title="Unknown Function" style="color: blue; font-weight: bold">iff</span></span>(<span title="[java61764X1X4][G:2][Q:50]: Hoeveel huisdieren heeft u?; value=1" style="color: maroon; font-weight: bold">numPets</span> &gt; <span title="[java61764X1X3][G:2][Q:40]: Hoeveel kinderen heeft u?; value=2" style="color: green; font-weight: bold">numKids</span>,1,2)</span><br>Onbekende variabele: <span style="background-color: #eee8aa;"><span title="Calculate the sum of values in an array; number sum(arg1, arg2, ... argN)" style="color: blue; font-weight: bold">sum</span>(<span title="[java61764X1X2][G:2][Q:30]: Hoe oud bent u?; value=45" style="color: green; font-weight: bold">age</span>,<span title="Onbekende variabele" style="border-style: solid; border-width: 2px; border-color: red;"><span title="Onbekende variabele" style="color: red; font-weight: bold">num_pets</span></span>,<span title="[java61764X1X3][G:2][Q:40]: Hoeveel kinderen heeft u?; value=2" style="color: green; font-weight: bold">numKids</span>)</span><br>Verkeerd aantal parameters: <span style="background-color: #eee8aa;"><span title="Function must have at least 1 argument(s); Not a valid expression" style="border-style: solid; border-width: 2px; border-color: red;"><span title="Function must have at least 1 argument(s); Not a valid expression; Return a formatted string; string sprintf(format, arg1, arg2, ... argN)" style="color: blue; font-weight: bold">sprintf</span></span>()</span>,<span style="background-color: #eee8aa;"><span title="Function does not support that number of arguments:  2.  Function supports this many arguments, where -1=unlimited: 3; Not a valid expression" style="border-style: solid; border-width: 2px; border-color: red;"><span title="Function does not support that number of arguments:  2.  Function supports this many arguments, where -1=unlimited: 3; Not a valid expression; Excel-style if(test,result_if_true,result_if_false); if(test,result_if_true,result_if_false)" style="color: blue; font-weight: bold">if</span></span>(1,2)</span>,<span style="background-color: #eee8aa;"><span title="Function does not support that number of arguments:  0.  Function supports this many arguments, where -1=unlimited: 1,2; Not a valid expression" style="border-style: solid; border-width: 2px; border-color: red;"><span title="Function does not support that number of arguments:  0.  Function supports this many arguments, where -1=unlimited: 1,2; Not a valid expression; Format a local date/time; string date(format [, timestamp=time()])" style="color: blue; font-weight: bold">date</span></span>()</span><br>Read-only variabelen wijzigen:<span style="background-color: #eee8aa;"><span title="The value of this variable can not be changed; Not a valid expression" style="border-style: solid; border-width: 2px; border-color: red;"><span title="The value of this variable can not be changed; Not a valid expression; ; value=worker" style="color: #996600; font-weight: bold">TOKEN:ATTRIBUTE_1</span></span><span title="Assigning a new value to a variable" style="color: red; font-weight: bold">+=</span>10</span>,<span style="background-color: #eee8aa;"><span title="The value of this variable can not be changed; Not a valid expression" style="border-style: solid; border-width: 2px; border-color: red;"><span title="The value of this variable can not be changed; Not a valid expression; [java61764X1X1][G:1][Q:10]: Wat is uw voornaam?; value=Peter" style="color: green; font-weight: bold">name</span></span><span title="Assigning a new value to a variable" style="color: red; font-weight: bold">=</span><span title="" style="color: gray">'Sally'</span></span><br>Unbalanced parentheses: <span style="background-color: #eee8aa;"><span title="Parentheses not balanced" style="border-style: solid; border-width: 2px; border-color: red;"><span title="Parentheses not balanced; Exponential expression; number pow(base, exp)" style="color: blue; font-weight: bold">pow</span></span>(3,4</span>,<span style="background-color: #eee8aa;"><span title="Parentheses not balanced" style="border-style: solid; border-width: 2px; border-color: red;">(</span><span title="Exponential expression; number pow(base, exp)" style="color: blue; font-weight: bold">pow</span>(3,4)</span>,<span style="background-color: #eee8aa;"><span title="Exponential expression; number pow(base, exp)" style="color: blue; font-weight: bold">pow</span>(3,4)<span title="Extra right parentheses detected" style="border-style: solid; border-width: 2px; border-color: red;">)</span></span>

Revision as of 15:05, 21 May 2020

Message definition (ExpressionScript How-tos)
</td><td><b>Here are common errors so you can see the tooltips</b><br>Variables used before they are declared:  <span style="background-color: #eee8aa;"><span title="This variable is not declared until a later page; Not a valid expression" style="border-style: solid; border-width: 2px; border-color: red;"><span title="This variable is not declared until a later page; Not a valid expression; [java61764X3X6][G:3][Q:200]: Who will win the next election?; value=?" style="color: #FF00FF ; font-weight: bold">notSetYet</span></span></span><br>Unknown Function:  <span style="background-color: #eee8aa;"><span title="Undefined function" style="border-style: solid; border-width: 2px; border-color: red;"><span title="Undefined function" style="color: blue; font-weight: bold">iff</span></span>(<span title="[java61764X1X4][G:2][Q:50]: How many pets do you have?; value=1" style="color: maroon; font-weight: bold">numPets</span> &gt; <span title="[java61764X1X3][G:2][Q:40]: How many kids do you have?; value=2" style="color: green; font-weight: bold">numKids</span>,1,2)</span><br>Unknown Variable: <span style="background-color: #eee8aa;"><span title="Calculate the sum of values in an array; number sum(arg1, arg2, ... argN)" style="color: blue; font-weight: bold">sum</span>(<span title="[java61764X1X2][G:2][Q:30]: How old are you?; value=45" style="color: green; font-weight: bold">age</span>,<span title="Undefined variable" style="border-style: solid; border-width: 2px; border-color: red;"><span title="Undefined variable" style="color: red; font-weight: bold">num_pets</span></span>,<span title="[java61764X1X3][G:2][Q:40]: How many kids do you have?; value=2" style="color: green; font-weight: bold">numKids</span>)</span><br>Wrong # parameters: <span style="background-color: #eee8aa;"><span title="Function must have at least 1 argument(s); Not a valid expression" style="border-style: solid; border-width: 2px; border-color: red;"><span title="Function must have at least 1 argument(s); Not a valid expression; Return a formatted string; string sprintf(format, arg1, arg2, ... argN)" style="color: blue; font-weight: bold">sprintf</span></span>()</span>,<span style="background-color: #eee8aa;"><span title="Function does not support that number of arguments:  2.  Function supports this many arguments, where -1=unlimited: 3; Not a valid expression" style="border-style: solid; border-width: 2px; border-color: red;"><span title="Function does not support that number of arguments:  2.  Function supports this many arguments, where -1=unlimited: 3; Not a valid expression; Excel-style if(test,result_if_true,result_if_false); if(test,result_if_true,result_if_false)" style="color: blue; font-weight: bold">if</span></span>(1,2)</span>,<span style="background-color: #eee8aa;"><span title="Function does not support that number of arguments:  0.  Function supports this many arguments, where -1=unlimited: 1,2; Not a valid expression" style="border-style: solid; border-width: 2px; border-color: red;"><span title="Function does not support that number of arguments:  0.  Function supports this many arguments, where -1=unlimited: 1,2; Not a valid expression; Format a local date/time; string date(format [, timestamp=time()])" style="color: blue; font-weight: bold">date</span></span>()</span><br>Assign read-only-vars:<span style="background-color: #eee8aa;"><span title="The value of this variable can not be changed; Not a valid expression" style="border-style: solid; border-width: 2px; border-color: red;"><span title="The value of this variable can not be changed; Not a valid expression; ; value=worker" style="color: #996600; font-weight: bold">TOKEN:ATTRIBUTE_1</span></span><span title="Assigning a new value to a variable" style="color: red; font-weight: bold">+=</span>10</span>,<span style="background-color: #eee8aa;"><span title="The value of this variable can not be changed; Not a valid expression" style="border-style: solid; border-width: 2px; border-color: red;"><span title="The value of this variable can not be changed; Not a valid expression; [java61764X1X1][G:1][Q:10]: What is your first/given name?; value=Peter" style="color: green; font-weight: bold">name</span></span><span title="Assigning a new value to a variable" style="color: red; font-weight: bold">=</span><span title="" style="color: gray">'Sally'</span></span><br>Unbalanced parentheses: <span style="background-color: #eee8aa;"><span title="Parentheses not balanced" style="border-style: solid; border-width: 2px; border-color: red;"><span title="Parentheses not balanced; Exponential expression; number pow(base, exp)" style="color: blue; font-weight: bold">pow</span></span>(3,4</span>,<span style="background-color: #eee8aa;"><span title="Parentheses not balanced" style="border-style: solid; border-width: 2px; border-color: red;">(</span><span title="Exponential expression; number pow(base, exp)" style="color: blue; font-weight: bold">pow</span>(3,4)</span>,<span style="background-color: #eee8aa;"><span title="Exponential expression; number pow(base, exp)" style="color: blue; font-weight: bold">pow</span>(3,4)<span title="Extra right parentheses detected" style="border-style: solid; border-width: 2px; border-color: red;">)</span></span>

Enkele gebruikelijke fouten, kijk naar de tooltips
Variabelen gebruiken voor definitie: notSetYet
Onbekende functie: iff(numPets > numKids,1,2)
Onbekende variabele: sum(age,num_pets,numKids)
Verkeerd aantal parameters: sprintf(),if(1,2),date()
Read-only variabelen wijzigen:TOKEN:ATTRIBUTE_1+=10,name='Sally'
Unbalanced parentheses: pow(3,4,(pow(3,4),pow(3,4))