Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tabing
#1
okay, I am currently working on a program for keeping inventory for the carlot I am at, it is a small personal project. What I am needing to figure out though are 3 things:
1.) How to make a Database file that can append a record to the end of it and remove records and fill in the empty spaces.
2.) How to set up the program so you can simply <TAB> from field to field and input the data into those fields.
3.) How to populate a screen with info from the database and then allow it to be scrolled through if there is more than can be displayed on the screen.

I have never tried his in QBASIC, so it is difficult for me. In Visual Basic it was easier than hell, but I don't have access to that here at work. Thanks for any assistance that can be offered
-Billy
Reply
#2
Maybe you could download visual basic for dos, which has built in gui functions.
/post]
Reply
#3
Quote:okay, I am currently working on a program for keeping inventory for the carlot I am at, it is a small personal project. What I am needing to figure out though are 3 things:
1.) How to make a Database file that can append a record to the end of it and remove records and fill in the empty spaces.
2.) How to set up the program so you can simply <TAB> from field to field and input the data into those fields.
3.) How to populate a screen with info from the database and then allow it to be scrolled through if there is more than can be displayed on the screen.

I have never tried his in QBASIC, so it is difficult for me. In Visual Basic it was easier than hell, but I don't have access to that here at work. Thanks for any assistance that can be offered
-Billy
My first reaction, since you say it's easy in VB, is to suggest you develop it in VB and transport the executable stuff over to the car-lot machine for running there. I don't know VB, so I'm not sure this can be done, but consider it.

If you need to develop it in QBasic, then here's some thoughts regarding your 3 questions:

1) Regarding the "database" file that you need, many forum members would probably tell you to use a RANDOM file. Since you're new to QB, this might get a little difficult for you, plus I can't help you because I never use RANDOM.

In my opinion, the easiest is a plain sequential text file. The first field in the file should be the "key" number or the car number, which is probably a number that you will assign to each car that you are going to put on the file. Don't try to invent a smart number for this, just use a 4 digit number. Start your numbers with 1001 so you don't have to put in leading zeros. A 4 digit number starting with 1001 will allow you 8998 cars on the file --- which is plenty.

I suggest making each field on the file of fixed length using the maximum size of each field. This way, you know where each field begins and ends.

Using a sequential file, when looking for a car number, you will have to read records until you find it. This may sound slow, but in reality it will take less than 2 seconds for the worst case. When you want to add a record, you'll need to read the entire file to make sure that this new car number does not already exist.

So, the first thing you need to do is design or layout your file, deciding the max length of each field, and defining the start and end byte locations of each field.

2) Doing a TAB from field to field can be accomplished just as easy by pressing Enter to go to the next field. When your input routine gets an input value of null for a field, it knows to just go to the next field.

3) For this, you have to design the screen. I suggest you put all the long fields in the same column, and the short fields in another column. If you have to, you can design more than 2 columns of data on the screen.

The problem of everything not fitting on one screen is a pain in the butt. There are several ways to do this, but none are easy. You'll need a separate subroutine, Sub, or Function for each of the 2 screens, so you can go back and forth.

If all the data doesn't fit one screen, the problem arises not only for displaying the data, but also for inputting the data.

Billy, let me tell you that this is not a simple program. It's not actually difficult, but it certainly is tedious. Believe me, I've done similar programs. The best I can do is suggest that you keep data on the file that is only absolutely necessary, keeping the number of data fields to a minimum. Also, keep the data as short as possible. These last two suggestions may avoid having to have multiple screens.

Remember that there are only 3 things you can do to records in a file:
1. Add records
2. Change records (you never mentioned this)
3. Delete records

Another thing that you'll need to do is validate each field as it is entered. Don't let garbage get into your file.

Good luck!
*****
Reply
#4
Thank you for your assistance. I actually found a very nice database program that I am taking apart on the forums in the newbie section.
Now about the tabbing and such though, the thing is I am not going to be using a basic input statment becuase I want all of the fields displayed at once and able to take input. the active field needs to be highliighted, and of course there will be verification when data is entered. I did find a nice program for tabbing, but it only handles a single colum, I have 3 colums on the screen.
Reply
#5
It sounds like you're on your way.

Let us know if you have any problems or questions.
*****
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)