I am wanting to save a list of peoples names into a file!
Initially, the list is small but I want my program to add names to my list.
My difficulty is that I want my People$() array to increase in size as names are added!
This so my program can allocate People$(# according to list in file at start up!)
Understand what I don't understand? I could use some help.
Some example code might be helpful.
Thanks
Updating the size of an array
-
- Posts: 2
- Joined: Mon Sep 22, 2014 9:30 pm
- My devices: Iphone 5
someday IPhone 6 Plus
- Mr. Kibernetik
- Site Admin
- Posts: 4786
- Joined: Mon Nov 19, 2012 10:16 pm
- My devices: iPhone, iPad, MacBook
- Location: Russia
- Flag:
Re: Updating the size of an array
You cannot increase size of your array and keep its old values intact.
If you create array of bigger size, it is re-initialized.
So you have to create your own algorithm of adding new values to your array.
There can be many different approaches, for example use intermediate array to keep old values before you increase size of your array.
If you create array of bigger size, it is re-initialized.
So you have to create your own algorithm of adding new values to your array.
There can be many different approaches, for example use intermediate array to keep old values before you increase size of your array.
-
- Posts: 2
- Joined: Mon Sep 22, 2014 9:30 pm
- My devices: Iphone 5
someday IPhone 6 Plus
Re: Updating the size of an array
Thank you for your quick response.
I have some ideas I think may work.
I'll update this post after my idea is tried and hopefully succeeds!
- I value your time! Thanks
I have some ideas I think may work.
I'll update this post after my idea is tried and hopefully succeeds!
- I value your time! Thanks
-
- Posts: 814
- Joined: Tue Apr 09, 2013 12:23 pm
- My devices: iPhone,iPad
Windows - Location: Groningen, Netherlands
- Flag:
Re: Updating the size of an array
You might have a look into the program "password manager" in this program section.
There an extensible array of strings is used to fully fit in a UI list. With "add" and "delete" functions
There an extensible array of strings is used to fully fit in a UI list. With "add" and "delete" functions