Variable Math

I just did this with two variables, v3 and v4. I used Lex's first form where I set a variable (v7). It is clearer to me. Code that worked looked like this:Javascript: Varv3.value*Varv4.valueBUT I had to reference both v3 and v4 somewhere on the page - otherwise they are undefined. I tried putting them on the condition with ANY but that did not work as the last variable was always undefined. What did work was using Allv3 Not equal to 9999v4 Not equal to 9999I didn't need all the (). Lex, what are they for?This form avoids the use of HTML names which become a bit more difficult to understand for most people taking over your code.Also, you might want to begin your variable names with a capital or an underscore so it becomes either V3 or _v3. Then the line of code becomes:Javascript: Var_v3.value*Var_v4.value orJavascript: VarV3.value*VarV4.valueThe _ have the additional benefit of separating all your variables from the Lectora variables when managing variables in Lectora.Edited By: Ben Pitman on 2007-8-14 8:54:33

Discussions have been disabled for this post