Thanks for the replies.
Maybe I'm going about this wrong. Let me try to explain what I want to do:
I have a function within which a number of "constants" are set depending on which value a pull down is set to. To avoid setting about 10 "constants" (based on the pull down selected), I thought I could drop in code like a string.
So....
If the drop down (t) is set to 1, include the following code at a specific point in funcA (a different function):
[code]
if (j1=="right" && i1<24) {
i1 = parseInt(i1)+1;
} else if (j1=="down" && i1<19) {
i1 = parseInt(i1)+6;
} else {
i1 = parseInt(j1); }
[code]
If the drop down (t) is set to 2, include the following code at the same specific point in funcA:
-
if (j1=="right" && i1<48) {
-
i1 = parseInt(i)+1;
-
} else if (j1=="down" && i1<43) {
-
i1 = parseInt(i1)+6;
-
} else {
-
i1 = parseInt(j1); }
-
There are actually a lot more "else if" statements, so it would get quite difficult to set "24/48", "19/43", etc, as variables --- I think!
Thanks!