473,808 Members | 2,832 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1409
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
3927
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 ($i=0 ; $i < 1000; $i++) $myarr = 0;
3
34890
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. If at least one element is non-empty, then the entire condition is false. $my_arr = array(); $my_arr = ""; $my_arr = "";
7
3202
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 up looking for characters that wrap around the stripped characters and it ends up as a recursive ordeal that fails to identify a poorly constructed $_GET variable (when someone hand-types the item into the line and makes a simple typing error).
23
7426
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 in an array. The application compiles but aborts without giving me any useful information. What I suspect is happening is infinite recursion. Each Directory object creates an array of Subdirectories each of which has an array of...
2
2519
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 the array is an object itself but what is this syntax of the consecutive double quotes inside the brackets ?
0
1730
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 webservice, I'll receive an empty one, not null. The target would be to pass a null-value as input and also receive it like that - and also pass an empty array and receive it as empty. I found something about that problem here http://www-128.ibm.com/
12
123764
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 that my returned array is not empty -- zzapper
14
2640
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 var arr2 = new Array(); I've been a-googling, but the best reason for this that I can find is
30
3622
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 defining this variable: char *y = { /* bunch of stuff */ } and calling
36
9196
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
0
9721
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10631
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10374
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10114
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9196
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6880
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5548
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5686
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4331
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.