>>Hello - Unfortunately vfp software doesn't let me create a square sparse matrix (as is doing - for example Matlab software); because I need to overcome the limit of 65,000 memory variables (even double ...) , I'm looking for a solution - anyone has a idea - it is welcome. Thanks in advance for your help, bye, Sorin
>
>
>(1) Use Collections - the key would be the string of the index
>For mulitdimension you'll need to add other collecttions
>
>This becomes a bit messy
>
>(2) If all elements are the same type, use SafeArray
>SafeArrays are allocated by windows
>
>
http://msdn.microsoft.com/en-us/library/ms221145(v=VS.85).aspx>
>- SaveArrayCreate() or SafeArrayCreateEx() for structures
>You can specify the number of dimensions and the lower/upperbounds for each dimension
>
>- SafeArrayCreateVector() for one dimensional arrays
>
>- SafeArrayDestroy() when you no longer need it
>
>
>- SafeArrayPutElement () to assign a value to an element
>- SafeArrayGetElement() to get the contents fo an element
>
>
>
>(3) a Cursor may be the simplest way
I like the cursor idea:
PrimaryKey XSubscript YSubscript (ZSubscript...) Value
1 1 1 ... 42
...
Completely sparse "array" with up to about 250 "dimensions", if you want. Easy to insert/remove elements as needed.
Regards. Al
"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov
Neither a despot, nor a doormat, be
Every app wants to be a database app when it grows up