Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 need help with database
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
JHDK




PostPosted: Wed Jan 14, 2004 9:32 pm   Post subject: need help with database

A basic database for school. But i cant not get the whole thing to work!!
Arrgh never mind the sample thing. please help me with this. i cant fix it. if i change some lines, something else will go wrong
Sponsor
Sponsor
Sponsor
sponsor
poly




PostPosted: Wed Jan 14, 2004 9:40 pm   Post subject: (No subject)

use the search feature. There's probably a few tutorials that can help you out (maybe even some code). Posting your code helps too, cause we could point ya in right direction and actually see the problem your having
Mazer




PostPosted: Wed Jan 14, 2004 9:43 pm   Post subject: Re: need help with database

JHDK wrote:
A basic database for school. But i cant not get the whole thing to work!!
could anyone just give me a simple sample database plz?

Well, I don't happen to have any sample databases lying around here, and to tell the truth at first I got the idea that you wanted somebody to do your whole assignment for you... but I was wrong, right?
Look at this for starters:
code:

type thing :
    record
        num : int
        name : string
    end record
   
var item : thing

item.num := 5
item.name := "JHDK"

put item.num
put item.name

You can use types to create your own kind of variables. That would be like a record in a database program. And each variable inside the type would be like the fields in a record of a database program. Try playing around with that a bit and see what you can find out. Then if there are problems you can ask for help and I'd be glad to help you out. (But please don't ask people to do it all for you)
JHDK




PostPosted: Wed Jan 14, 2004 9:46 pm   Post subject: (No subject)

Some common error i keep getting are:
-attempt to read past eof
-array subscript out of range
And if i mess up with a text file once, i have to do make a new one.
this usually happens when i write the data to a file, quit the program, and try to rerun it.
McKenzie




PostPosted: Wed Jan 14, 2004 10:08 pm   Post subject: (No subject)

The easiest way to handle the eof (end-of-file) is actualy to modify your data file to add an integer at the very start. this integer will be the number of records in the file. You set it to start then whenever you save the file make sure you put it back.
As far as array subscript you are either looking at spot 0, or past the max size of your array.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 5 Posts ]
Jump to:   


Style:  
Search: