Hi,
Small question re the use of an Array.
I'v got an array with x rowObjects in it.
When i get it the type of the container is Array and i can get a hold of
the objects just fine.
owever, how do i get the length of the array?
For container.lengt h does not seem to work.
TIA
Fermin DCG
dacostagomez at gmail.com 4 1514
"F Da Costa" wrote Small question re the use of an Array. I'v got an array with x rowObjects in it. When i get it the type of the container is Array and i can get a hold of the objects just fine.
owever, how do i get the length of the array? For container.lengt h does not seem to work.
You have misspelled the word length as lenght. Happens all the time.
Or provide some clues by showing us some code.
HTH
Ivo
Ivo wrote: "F Da Costa" wrote
Small question re the use of an Array. I'v got an array with x rowObjects in it. When i get it the type of the container is Array and i can get a hold of the objects just fine.
owever, how do i get the length of the array? For container.lengt h does not seem to work.
You have misspelled the word length as lenght. Happens all the time. Or provide some clues by showing us some code.
Point wel taken. Unfortunately there was no typo.
To make matters worse. When using the Venkman debugger the content of
the object (of type Array) showed the two HtmlRowTableEle ments just fine
and the parameter length said 0.
Following the code:
....
var ch = getChildSegment s(segment, 1);
if (ch.length>0)
displayDirectCh ildren(ch, onOff);
....
ch is filled correctly as verified in the debugger, breakpoint on the if
line.
The displayDirectCh ildren function is correct because this line is the
last one in that particular function (recursive call).
TIA
Fermin DCG
F Da Costa wrote: Ivo wrote:
<snip> Or provide some clues by showing us some code.
<snip> Following the code: ... var ch = getChildSegment s(segment, 1); if (ch.length>0) displayDirectCh ildren(ch, onOff); ...
<snip>
No array is created of filed in this code. The contents of the -
getChildSegment s - function would be more relevant, along with the
context in which it is called (i.e. what does - segment - refer to?).
Richard.
F Da Costa wrote: Ivo wrote: "F Da Costa" wrote
Small question re the use of an Array. I'v got an array with x rowObjects in it. When i get it the type of the container is Array and i can get a hold of the objects just fine.
owever, how do i get the length of the array? For container.lengt h does not seem to work.
You have misspelled the word length as lenght. Happens all the time. Or provide some clues by showing us some code.
Point wel taken. Unfortunately there was no typo. To make matters worse. When using the Venkman debugger the content of the object (of type Array) showed the two HtmlRowTableEle ments just fine and the parameter length said 0.
Following the code: ... var ch = getChildSegment s(segment, 1); if (ch.length>0) displayDirectCh ildren(ch, onOff); ...
ch is filled correctly as verified in the debugger, breakpoint on the if line. The displayDirectCh ildren function is correct because this line is the last one in that particular function (recursive call).
TIA Fermin DCG
ch can exist such that (ch.constructor == Array) evaluates to true, it can
contain information you have placed in it, and still have ch.length == 0.
var a = new Array();
a["a"] = "a";
a["b"] = "b";
alert(a.length) ;
Without knowing how you are populating ch, it's difficult to tell if this is
the problem or not. For example, you may be doing:
var tableRows = new Array();
tableRows["row0"] = row0;
tableRows["row1"] = row1;
// etc
return tableRows;
In which case, tableRows.lengt h will most certainly be 0.
--
Grant Wagner <gw*****@agrico reunited.com>
comp.lang.javas cript FAQ - http://jibbering.com/faq This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Federico G. Babelis |
last post by:
Hi All:
I have this line of code, but the syntax check in VB.NET 2003 and also in
VB.NET 2005 Beta 2 shows as unknown:
Dim local4 As Byte
Fixed(local4 = AddressOf dest(offset))
CType(local4, Short) = CType(src, Short)
|
by: Denis Perelyubskiy |
last post by:
Hello,
I need to make an array of elements accross forms.
My javascript skills, as evident from this question,
are rather rudimentary.
I tried to make an associative array and index it
with the object references. However, I just realized
that indices may only be referenced by strings.
|
by: VK |
last post by:
A while ago I proposed to update info in the group FAQ section, but I
dropped the discussion using the approach "No matter what color the cat
is as long as it still hounts the mice". Over the last month I had
enough of extra proof that the cat doesn't hount mice anymore in more
and more situations. And the surrent sicretisme among array and...
|
by: VK |
last post by:
Hello,
In my object I have getDirectory() method which returns 2-dimentional
array
(or an imitation of 2-dimentional array using two JavaScript objects
with auto-handled length property - please let's us do not go into an
"each dot over i" clarification discussion now - however you want to
call - you call it ;-)
array contains records of...
|
by: fdunne2 |
last post by:
The following C-code implements a simple FIR filter:
//realtime filter demo
#include <stdio.h>
#include <stdlib.h>
//function defination
float rtFilter1(float *num, float *den, float *xPrev, float *yPrev);
| |
by: truckaxle |
last post by:
I am trying to pass a slice from a larger 2-dimensional array to a
function that will work on a smaller region of the array space. The
code below is a distillation of what I am trying to accomplish.
// - - - - - - - - begin code - - - - - - -
typedef int sm_t;
typedef int bg_t;
sm_t sm;
bg_t bg;
|
by: RyanTaylor |
last post by:
I have a final coming up later this week in my beginning Java class and my
prof has decided to give us possible Javascript code we may have to write.
Problem is, we didn't really cover JS and what we covered was within the
last week of the class and all self taught.
Our prof gave us an example of a Java method used to remove elements from an...
|
by: mflll |
last post by:
I am looking into the different techniques of handling arrays of edit
boxes in
Java Script. The first program below works fine. However, are there
better ways of
doing this, where the person writing the JavaScript doesn't have to
pass the index
in the "onChange" event name.
I thought that one might be able to use "this.value" or...
|
by: Robert Bevington |
last post by:
Hi all,
I ran into memory problems while tying to search and replace a very large
text file. To solve this I break the file up into chunks and run the search
and replace on each chunk. This works fine and has solved the OutOfMemory
problem.
However, on the last loop when the array c is written to CleanTMX, a number
of 0x00 characters are...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language...
|
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. ...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
|
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...
|
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...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...
| |