How best to deal with unknown data size with an Array or Data command

Post Reply
highfell
Posts: 3
Joined: Tue Aug 23, 2016 2:07 pm
Flag: Great Britain

How best to deal with unknown data size with an Array or Data command

Post by highfell »

Hi all

Just seen this App in the store and purchased it with much enthusiasm.

I am looking to create a program that is a cross between a project management/to do program.

In setting up the program, one of the initial challenges is how to deal with an unknown maximum amount of data. Can I program some kind of dynamic Array command or Data command to deal with adding new information? Or am I best to create for example an Array to begin with using the DIM command like this DIM Array (10000,10000,10000) - on the basis that the users won't ever input more than 10,000 say items.

Thanks for any advice.

User avatar
rbytes
Posts: 1338
Joined: Sun May 31, 2015 12:11 am
My devices: iPhone 11 Pro Max
iPad Pro 11
MacBook
Dell Inspiron laptop
CHUWI Plus 10 convertible Windows/Android tablet
Location: Calgary, Canada
Flag: Canada
Contact:

Re: How best to deal with unknown data size with an Array or Data command

Post by rbytes »

Smart BASIC allows for dimensioning arrays using variables. You could start by dimensioning your arrays as small as (1000, 1000, 1000), and redimensioning them larger when critical values reach a certain point. Redimensioning would clear all data in the array, but this would not be a problem if you are doing regular saves to data files. Your code could do a save before the redimensioning, and a load afterward.
The only thing that gets me down is gravity...

highfell
Posts: 3
Joined: Tue Aug 23, 2016 2:07 pm
Flag: Great Britain

Re: How best to deal with unknown data size with an Array or Data command

Post by highfell »

Many Thanks. So that would resolve my issue, if needed.

I am just re-acquainting myself with basic after many years, so expect some noobish questions .....

Sometimes it is easier to ask rather than spend days puzzling what the issue is. :mrgreen:

User avatar
rbytes
Posts: 1338
Joined: Sun May 31, 2015 12:11 am
My devices: iPhone 11 Pro Max
iPad Pro 11
MacBook
Dell Inspiron laptop
CHUWI Plus 10 convertible Windows/Android tablet
Location: Calgary, Canada
Flag: Canada
Contact:

Re: How best to deal with unknown data size with an Array or Data command

Post by rbytes »

I know what you mean. I had done a fair bit of previous programming when I discovered smart BASIC almost two years ago, but I had to learn from the ground up. I think my first program had 10 lines of code!
The only thing that gets me down is gravity...

Henko
Posts: 814
Joined: Tue Apr 09, 2013 12:23 pm
My devices: iPhone,iPad
Windows
Location: Groningen, Netherlands
Flag: Netherlands

Re: How best to deal with unknown data size with an Array or Data command

Post by Henko »

highfell wrote:Hi all

Just seen this App in the store and purchased it with much enthusiasm.

I am looking to create a program that is a cross between a project management/to do program.

In setting up the program, one of the initial challenges is how to deal with an unknown maximum amount of data. Can I program some kind of dynamic Array command or Data command to deal with adding new information? Or am I best to create for example an Array to begin with using the DIM command like this DIM Array (10000,10000,10000) - on the basis that the users won't ever input more than 10,000 say items.

Thanks for any advice.
I started a project management program in 2014, but did not finish it. Maybe the GUI is of interest for you. The program is somewhere in the program section.
image.png
image.png (369.87 KiB) Viewed 1991 times

highfell
Posts: 3
Joined: Tue Aug 23, 2016 2:07 pm
Flag: Great Britain

Re: How best to deal with unknown data size with an Array or Data command

Post by highfell »

Henko wrote:
highfell wrote:Hi all

Just seen this App in the store and purchased it with much enthusiasm.

I am looking to create a program that is a cross between a project management/to do program.

In setting up the program, one of the initial challenges is how to deal with an unknown maximum amount of data. Can I program some kind of dynamic Array command or Data command to deal with adding new information? Or am I best to create for example an Array to begin with using the DIM command like this DIM Array (10000,10000,10000) - on the basis that the users won't ever input more than 10,000 say items.

Thanks for any advice.
I started a project management program in 2014, but did not finish it. Maybe the GUI is of interest for you. The program is somewhere in the program section. More to follow once I make some progress or need some more help

image.png
Thanks for this, very kind of you. I have though already decided on the concept of the program which is slightly different from the norm, and won't fit with your design.

Post Reply