473,385 Members | 2,180 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

var in array if not empty

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
Jul 23 '05 #1
2 1389
On Wed, 3 Nov 2004 23:45:16 +0100, rlo <rl*@hetstreek.nl> wrote:

[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.

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #2
rlo wrote:
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
--
Every knee shall bend, every mouth open, when I unzip
Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Pjotr Wedersteers | last post by:
Hello, I tried to create an array with 1000 cells, keys 0 thru 999 using $myarr = array (1000); But this leads to an array of 1 cell with value 1000; Now I have a workable solution for...
3
by: laredotornado | last post by:
Hi, Wondered if there was a good one-liner for what I want to do in PHP 4. I have an array, with an arbitrary number of elements. I'd like to know if all the elements in the array are empty. ...
7
by: Jim Carlock | last post by:
Looking for suggestions on how to handle bad words that might get passed in through $_GET variables. My first thoughts included using str_replace() to strip out such content, but then one ends...
23
by: sandy | last post by:
I need (okay, I want) to make a dynamic array of my class 'Directory', within my class Directory (Can you already smell disaster?) Each Directory can have subdirectories so I thought to put these...
2
by: JJA | last post by:
I'm looking at some code I do not understand: var icons = new Array(); icons = new GIcon(); icons.image = "somefilename.png"; I read this as an array of icons is being built. An element of...
0
by: dani.meier | last post by:
Hi I have a webservice which takes an Array as input. This Array is nullable and a null-array is treated different than an empty one. My propblem is now, that if I pass a null-array to the...
12
by: zzapper | last post by:
Hi, Have tried to google this without 100% satisfaction. A function reads a mysql record into an array and returns it, if it doesnt exist it returns '' or FALSE. What ways do I have to test...
14
by: Dan Rumney | last post by:
I've been taking a look at Douglas Crockford's JSLint. One of the conventions that it expects is that arrays be created using literal notation var arr1 = ; as opposed to using a constructor...
30
by: ggnguser | last post by:
It's part of a test and I'm stumped. There is a function void foo(char **x) The function signature is given and cannot be changed, so no passing of other values. The test case involves...
36
by: laredotornado | last post by:
Hi, I'm using PHP 5. I have an array of strings. What is the simplest way to remove the elements that are empty, i.e. where the expression "empty($elt)" returns true? Thanks, - Dave
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.