Hi everyone,

Before i outline my problem, i DO have an alright idea of how i'll code this thing, it's just i'm unsure and wondering if there's a better or shorter or a more simple way.

Ok im at the end of my current term of programming and it's Assignment time (*yay*).
To keep this short, the program utilises TWO binary files (which currently work) to store a database using an array of records. It's a program for an imaginary doctor to store his/her patients info and appointments.

So there's got to be this delete procedure, which when you enter the patients id number (string record variable called 'PID'), an asii coded table appears with all appointment records associated with that particular person inside of it. Then (almost done) at the end it gets the user to choose which appointment record they want to delete, each record would have its own id as well. eg:

Persons name
1 record info
2 record info
3 record info

which one gets deleted?: 2 (delete 2, 3 moves up and becomes 2)

that's kind of what it'll look like but in an ascii table with that message underneath.

thanks to anyone for any help,
Quagmire.

Recommended Answers

All 2 Replies

Hi everyone,

>> the program utilises TWO binary files (which currently work) to store a database
>> using an array of records.
I've not understand what is your problem: if you utilise a database, you must study the theory of databases's working... or not?

>> So there's got to be this delete procedure, which when you enter the patients id
>> number (string record variable called 'PID'),
"PID" is, probably, a field of a record of a database: it's a good idea to give a number unique at this field for all the database.
When you digit this code, the procedure looks for this occurrence in the database (field PID) and display the content of the record.
If more than one record is connected (contains) with a name, the procedure shows a list with all records with the same name, but each record have a unique reference-code: the field PID.

>> Then (almost done) at the end it gets the user to choose which appointment
>> record they want to delete, each record would have its own id as well. eg:
>> Persons name
>> 1 record info
>> 2 record info
>> 3 record info
>> which one gets deleted?: 2 (delete 2, 3 moves up and becomes 2)

In this case, the record "3" moves up in the list, but the field "PID" is always the same, because the content is a value inserted by the user...
What you tell in your example, is the numeration of the records realized by the procedure that administers the accesses at the databases, an order of enumeration in the list, for visual order.
The user don't insert the value "2" to delete the record 2, but insert the appropriate value existing in the field "PID", or click on the grid, and in this case the record "active" is deleted; the re-numeration of the list (1,2,3...) don't affects the value of the fields "PID".
This is only theory, we are not discussed of classes or components or type of databases (they are more).
I hope that I have understand your doubth; an example "true" would be appreciated and I would told you more.
Antonio

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.