var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Acessing Dynamic Array elements by number
I know you can access normal array elements using the myarray type of syntax, but is it possible to access the elements of a dynamic array using the same type of syntax?
I.e instead of dynArr["name"] use dynArr ?
Thanks foir the help! Thought I'd accessed them this way before but now it doesn't seem to work!
A little juggling
keys in dynamic arrays are always strings instead of integers but you can get around it with a little juggling:
Say you have a dynamic array "lottastuff" with 12 elements,
you need to add a fixed string array variable say "lskeys"
Now you load the elements from lottastuff into lskeys with
At this point lskeys = the first element in lottastuff
lskeys = the second element in lottastuff etc.
Now to address an element in lottastuff directly using integers you simply use
lottastuff[lskeys] which would be the value of the third element in lottastuff.
Thanks very much, didn't think of it that way...
I got round what I was doing, albeit in a crappy way.. But it wasn't a very nice project I was working on and was glad to finish it heh
The order in which keys appear in a DynArray (e.g. with forEach) may change at any time. There is no concept of "ordering" of a dynamic array.
Likewise, in an ordinary Array, there is no concept of keys.
Actually the "order" of the keys don't change. There is no concept of "order." But a virtual order can be established using a standard array as a proxy.
The solution to the problem is not found in answering the question asked, but in understanding it.