Page 1 of 1

Problems with arrays

Posted: Fri Nov 22, 2013 7:24 am
by Kapow36

I'm having some trouble with arrays in Appery lately. Right now, I have 2d array that I want to access values from to create my own json object, but it keeps returning 'cannot read property 0 or undefined'

However, if I log it...

code
console.log(data[k][i*arrayLength+j]);
/code

it will log the result and then throw the error. Something seems fishy to me, it doesn't seem like it should work this way.


Problems with arrays

Posted: Fri Nov 22, 2013 8:36 am
by Maryna Brodina

Hello! Please check if data variable is defined. Do preconsole.log(data);/pre and check result in console.


Problems with arrays

Posted: Fri Nov 22, 2013 3:20 pm
by Kapow36

Yes it is, when I created the variable and assigned the array to it, I logged it as well, and I can see the array.


Problems with arrays

Posted: Sun Nov 24, 2013 4:50 am
by Kapow36

I just reloaded the application back to a previous version and it works fine now. However, I have been noticing stuff like this happening lately with code I know works, but isn't compiled correctly.


Problems with arrays

Posted: Mon Nov 25, 2013 4:52 pm
by Maryna Brodina

Hello! Could you give more details? Are there any steps to reproduce?


Problems with arrays

Posted: Tue Nov 26, 2013 5:24 am
by Kapow36

Basically, I modified the project and I can no longer call those 4 services manually using codeservicename.execute({});/code The app always gives an error, so it is always reproducible. I have a feeling that it isn't being compiled correctly.