Hello Servoy fooks!
I struggle with retrieving data from an (global) array… ![Crying or Very sad :cry:]()
The array has 3 columns and the amount of rows is determent by a foundset.
I filled the global with a loop,
then I set a var rownr with a method.
After that I like to retrieve data from the array: globals.myArray[rownr][2],
But that doesn’t work… I only get null…
What’s the right syntax to do this?
Is the global of type MEDIA?
I do (all the time) something like
if (!globals.myArray) {
globals.myArray = new Array();
}
globals.myArray[0] = new Array();
globals.myArray[0][0] = 'abc';
globals.myArray[0][1] = 'def';
without problems…
patrick:
I do (all the time) something like
if (!globals.myArray) {
globals.myArray = new Array();
}
globals.myArray[0] = new Array();
globals.myArray[0][0] = ‘abc’;
globals.myArray[0][1] = ‘def’;
without problems...
I don’t get what you mean here… ![Confused :?]()
globals.myArray[0][0] = ‘abc’; looks like setting an array, instead of retrieving data?
My code shows how I populate the array. Retrieving works just like you tried. Can you post the whole code that doesn’t seem to work?