Qbasicnews.com

Full Version: I have a question.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am kinda new to programming with Qbasic and i do know the basics. I was just wondering if there is a way that the computer can "learn" what is entered through input, I mean if I was making a program that has adresses and phone numbers would there be a way where the user can enter people for the program to store and then open the next time the user opens the program. :???:
input/output...

OPEN keyword...
Quote:I am kinda new to programming with Qbasic and i do know the basics. I was just wondering if there is a way that the computer can "learn" what is entered through input, I mean if I was making a program that has adresses and phone numbers would there be a way where the user can enter people for the program to store and then open the next time the user opens the program. :???:
Every piece of data that is entered by a user into a program can be written to an output file and later retrieved by the same or another program. Relationships can be established for different pieces of data, as per your example, addresses and phone numbers can be made to relate to each other when they are entered together. This relationship is established by putting the address data and phone data into the same record. As this file of address and phone numbers grows, you can think of it as if the program has *learned* the data. Now the program has the capability of being able to display street addresses and phone numbers for a given city or state. It reads the file to retrieve this information. The program has *learned* and can keep learning as the user enters more data.

Subscuently, as you add more data to each record, like name, age, height, weight, etc., your file gets richer in data and your program can retrieve and *remember* more information.

I hope the above gives you the idea that you were looking for.
*****
thank you that's what i was looking for but could you tell me what the code is for that?I would appreciate it.
OPEN...
Quote:thank you that's what i was looking for but could you tell me what the code is for that?I would appreciate it.
The code you're asking for is not a simple little program. In order for the program to be able to add or modify name records containing addresses and phone numbers, the file would best be a "random" type file for quick access. I never use random files, so I'm not qualified to give you sample coding.

You picked a master file update type program which as I said is no simple matter. If you are just beginning in programming, I suggest you pick a simpler program to learn with.
*****