Adding/Removing Array Values
Author |
Message |
Artimes
![](http://www.radiantskies.com/images/avatar1.png)
|
Posted: Wed Nov 10, 2004 5:40 pm Post subject: Adding/Removing Array Values |
|
|
I'm creating a database like program in class. My program provides up to 20 employees to a fake company with their names, hours worked, salery, and pacycheck in a table. I have a sorting algoryth that does just what it says. Sorts the values from greatest to least, you have the option which values you which to sort them by... My problem is when you remove someone from the lost I set their values to either 0 or " ", depending on the array type. Well the numbers all get shoved to the bottom and accual you just don't see... But the names... A space comes before "A", therefore at the top is the deleted person. Is there a way I can just remove the values or resize the array without reseting all the extensions on the array? (i.e. variables (1) := 1 etc)
I can get the program to work backwards (as in the least values appear at the top) |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Tony
![](http://wiki.compsci.ca/images/f/f4/OniTony.gif)
|
Posted: Wed Nov 10, 2004 11:15 pm Post subject: (No subject) |
|
|
there are multiple approaches you can take
1 - sort in opposite direction, such as replace < with > in your condition
2 - set nonexistant person's name to something like chr(255)+"gone" to garantee it will be alphaberically last
3 - use a flexable array to actually just delete unneeded element |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
![](images/spacer.gif) |
|
|