Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
OK, now what? (database program ideas needed)
#1
With a little help from RST (thanks), my program for collecting data for the calls at work is complete. The supervisor loves it and is going to present it to the woman in charge (you heard me).

All I need now is to create the database program. The first program collected data and used the "WRITE #1" command to put it in a text file with certain key words in quotes followed by a comma and the entered data, also in quotes (e.g. "CALLER:", "SHAGGY"). Often the entered data is by a choice from many on a list, occasionally it is entered manually. The next program needs to read all that and give statistics on the occurrence of entered data.

So, any ideas on how to create a database program based on the above description?

Shaggy
An ounce of clear thinking is worth a pound of research into the mysteries of the obvious."
--THOMAS SZASZ, MD.
New York Times
May 29, 2001
Reply
#2
you can use ISAM tables in QB PDS/7.1. Or you would be better off using C++. It is *superb* :bounce:
Reply
#3
Yes, C++ is superb... but I have yet to figure out the graphics part (BGI was no help). My program needs graphics, so I'm doing it in BASIC. It is more familiar ground for me when it comes to graphics. Luckily, I have PDS 7.1, so this project should be pretty easy with all the features it has. :lol:

One problem with ISAM tables, though. I thought using ISAM tables would return individual entries by searching until it finds that entry. I want my program to count the total number of entries for a given field in the file and return that number.

For example, I want the program to tell me how many callers we had on a given evening (by counting how many times "CALLER:" appears in the file). I also want the program to tell me how many times a particular caller called (by counting how many times a name appears in that field e.g. "CALLER:", "SHAGGY" appearing twice over the course of an evening).

Any ideas on how to do that?

Shaggy
An ounce of clear thinking is worth a pound of research into the mysteries of the obvious."
--THOMAS SZASZ, MD.
New York Times
May 29, 2001
Reply
#4
Your problem is quite complicated. But not impossible. If you have already written a prog. to collect the data then it is difficult. But read this anyway:
You should have had ideally created a type to do such a prog. For example:

Code:
TYPE CALLERTYPE
    CalledNumber AS STRING * 12 'Number that was called
    TimeOfCall      AS STRING *  7  'When was the call made?
    CallLength      AS INTEGER       'Length of call(<=32768 mins)
    LineUsed        AS INTEGER       'Line from which the call was made
    CallersName   AS STRING * 50 ' Name + MiddleName + Surname
                                                    'of caller
END TYPE

DIM CALLS(1 to 1000) AS CALLERTYPE

Then simply using input statements u could get the input for the req. fields and directly PUT this data in a binary file(see the code below, use PUT instead of a GET statement).

While retrieving a particular record all u had to do is use the GET command at the proper byte. Like this:

Code:
DIM TempCall as CALLERTYPE

TypeLen% = LEN(CALLS(1))
ReadByte% = ((ReqRecord% - 1) * TypeLen%) + 1)

GET #1, ReadByte%, TempCall
PRINT TempCall.CallersName....

Ok?

While searching all you gotta do is create an array like this:
Code:
DIM RecNos%(1 to 1000)

Count% = 0
DO
   Count% = Count% + 1
   'Here, use the upper code to get the data of the current record
   'in the TempCall var. Then check for your search criteria.
   'If it matches then store the record no. in the RecNos% array so
   'that u need not repeat the search everytime when the user asks
   'for the info. Unless ofcourse some record has changed.

   'When you want to display the records which matched the search
   'criteria all u need to do is get the records stored in RecNos%
   'array.
LOOP UNTIL EOF(1)

My last piece of advice would be don't use text files for storing such info. It is not the way you would want Oracle/Foxpro/Access to work. Because you are trying to make a DBMS basically.

Hope that helped 8)

TheBigBasicQ
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)