HighDots Forums  

problem with array

JavaScript discussion (multi-lingual) JavaScript discussion (alt.comp.lang.javascript)


Discuss problem with array in the JavaScript discussion (multi-lingual) forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Walter
 
Posts: n/a

Default problem with array - 09-12-2004 , 04:16 PM






Hi,

The array is ok, the values are put into the array, but when i need the
values of pex[i] further in the script, i get 'object' instead of the value.
Thanks for any hint
Walter
....
oRDS.SQL="select pcnr from pc;"
oRDS.Refresh()
recok=oRDS.Recordset.RecordCount (this produces e.g. 20)
var pex = new Array(recok)
for (i= 1;i<=recok;i++)
{
pex[i]=oRDS.Recordset("pcnr")
oRDS.Recordset.MoveNext
}

// this gives 'object' instead of the value!!
for (i= 1;i<=recok;i++)
{
alert(pex[i])
}
....



Reply With Quote
  #2  
Old   
Aidal
 
Posts: n/a

Default Re: problem with array - 12-10-2004 , 07:48 AM






What data type does oRDS.Recordset("pcnr") return?

If it returns an object and not a value, then that's why.

In that case you'd need to do:

alert(pex[i].attributeName);

/Aidal

"Walter" <dvsd (AT) qdd (DOT) fg> wrote

Quote:
Hi,

The array is ok, the values are put into the array, but when i need the
values of pex[i] further in the script, i get 'object' instead of the
value.
Thanks for any hint
Walter
...
oRDS.SQL="select pcnr from pc;"
oRDS.Refresh()
recok=oRDS.Recordset.RecordCount (this produces e.g. 20)
var pex = new Array(recok)
for (i= 1;i<=recok;i++)
{
pex[i]=oRDS.Recordset("pcnr")
oRDS.Recordset.MoveNext
}

// this gives 'object' instead of the value!!
for (i= 1;i<=recok;i++)
{
alert(pex[i])
}
...





Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.