How to declare & use dynamic array in navision ?

Hello, first of all excuse my english I am french [:#]

I am trying to use arrays in navision but I don’t know how to declare the length or depth of an array, only I can use like this : arrayX[integer] := …

I saw that there is a Dimension property for a variable (shift+F4), is it what I am searching ? but how can I dynamicly increase it ?

thanks for the help [;)]

Yes you are right, the Dimensions property is what you are looking for. It means the maximum number of elements in your array. No you cannot set this dynamically.

this means if I don’t know how long my array could be I can set the dimension to 1000000 ? [:S]


Or even better : use temp-tables. These are dynamic.

hmmm can I ask you how to use it ? or a link with some tutorial or anything on it ?

thanks for the help ! [:P]


Yes unfortunately arrays aren’t as useful in Navision (Dynamics NAV) as in mainstream programming languages like VB.NET or C#. And as one of the previous comments suggested, the use of temporary tables would satisfy as a work around for the ‘dynamics lenght of an array syndrome’.

As for an example of how to use temporary tables, just search the DUG and you shall find. For instance, try looking at this thread;

Good luck