Array limits

Miscellaneous Forums/General Discussion/Array limits

>I came up with this one night when i couldn't sleep trying
>to work out a way of storing data and getting it quickly
>for a chatbot.

What exactly do you need to do?

Your approach above saves words into an array and enables you to retrieve the words letter by letter, but in the process uses ridiculous amounts of memory.

You can readily do the same by using a one dimensional array

Dim a$(number of words) and then use Len (a$(number)) to find the length of that particular variable. Then you can use Left$, Right$ and Mid$ to retrieve the individual letters.

This approach is much less memory-intensive, but also much slower. However, it may fit a chat-bot very well, atleast test it and make up your mind.

>I think i misunderstand multidimentional arrays fullstop.

There is a reason it is called multiDIMENSIONAL.

Dim a$(10) can be visualized as a vertical column of cells where data can be stored.

Dim a$(64,64) can be visualized as a chess-board with vertical and horizontal cells where data can be stored.

Dim a$(10,10,10) can be visualized as an appartment-building where data can be stored in every appartment.

Dim a$(10,10,10,10) can be visualized as a road with 10 of the abovementioned appartment-buildings at the side.

As with everything, if you play around with arrays, you will learn to use them correctly.


Andy