Hi it's me again, I've pretty much finished a program I'm making, which does the following:
The program is for a garage, and it does the following functions:
Adds a new car
Display cars
Amend price of a car
Delete car ('sell' car)
Find a certain car
When the program is loaded, it attempts to read existing car data from a text file, which is then converted into an object array. Then when manipulation is finished with the details, it's all completely written back to the text file (Overwriting it, not appending to it).
Almost everything is working perfect, except that I can't get the 'delete' function working correctly. I have 5 fields in my object array, these are Registration Number, Manufacturer, Model (all 3 are strings), and year and price (which are ints). I've researched this and actually deleting from an array is nigh on impossible, but I realised that when data is written back to the text file straight after a car is sold, it skips all blank lines, so if I convert a car position's fields to blank, it'll do what I want it do...
Problem is, I need to somehow set the int to be 'blank'...not 0, just like a space. Is this possible? Thanks
The program is for a garage, and it does the following functions:
Adds a new car
Display cars
Amend price of a car
Delete car ('sell' car)
Find a certain car
When the program is loaded, it attempts to read existing car data from a text file, which is then converted into an object array. Then when manipulation is finished with the details, it's all completely written back to the text file (Overwriting it, not appending to it).
Almost everything is working perfect, except that I can't get the 'delete' function working correctly. I have 5 fields in my object array, these are Registration Number, Manufacturer, Model (all 3 are strings), and year and price (which are ints). I've researched this and actually deleting from an array is nigh on impossible, but I realised that when data is written back to the text file straight after a car is sold, it skips all blank lines, so if I convert a car position's fields to blank, it'll do what I want it do...
Problem is, I need to somehow set the int to be 'blank'...not 0, just like a space. Is this possible? Thanks
Comment