var in array if not empty

R

rlo

use the next script:

var answers0 = new Array(
(answer11),
(answer12),
(answer13),
(answer14) );
question[0]= new geefVraag( 0,
'question1', oke1-1, answers0);
feedback[0]= new Array(
'feedb1');

but antw11, antw12, antw13 and antw14 may only be used in the array if
antw11<>"" etc.

How can I slove this problem?
Ronald
 
M

Michael Winter

[snip]
How can I slove this problem?

Readers of this group are Dutch, and some can read it. It might be worth
asking the question again in your natural language and give a more
thorough explanation. Whilst I understand what you stated, I don't know
what you were asking.

There's nothing wrong with posting in a language other than English[1],
just realise that you might reduce the potential number of replies.

Good luck,
Mike


[1] Though a translation, if possible, in the same post might be nice.
 
T

Thomas 'PointedEars' Lahn

rlo said:
use the next script:

var answers0 = new Array(
(answer11),
(answer12),
(answer13),
(answer14) );

You may (and should) omit the parantheses around the values "answer11" aso.
unless the latter are not considered to be variable references but string
values; in that case change the parentheses into matching pairs of " or '.
question[0]= new geefVraag( 0,
'question1', oke1-1, answers0);

Unless `question' has not been defined to refer to an object (say, an
Object or Array object) earlier, this syntax causes a script error as
`question' cannot be resolved and neither can `question[0]'. This
aside, the declaration of the geefVraag() constructor is missing from
your source code, as well is the declaration of `oke1'; maybe there
is a bug, too.
feedback[0]= new Array(
'feedb1');

The same here. You should declare (with the `var' keyword) and must
define variables before you can successfully access the objects they
should refer to or their properties.
but antw11, antw12, antw13 and antw14 may only be used in the array
if antw11<>"" etc.

Sorry, I do not understand this.
How can I slove this problem?

I suggest you first read on the basics of J(ava)Script programming,
following the links in the FAQ.


HTH

PointedEars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top