Posts: 2
Threads: 1
Joined: Feb 2003
Is it possible to create a file and store records with a key index ??
I would like to be able to sort the records in the file and access records in the file by a key
Many thanks in advance
- Moz
Posts: 704
Threads: 0
Joined: Dec 2002
Look up "OPEN" and its "FOR RANDOM" option in the on-line help.
ravelling Curmudgeon
(geocities sites require copying and pasting URLs.)
I liked spam better when it was something that came in a can.
Windows should be defenestrated.
Posts: 1,407
Threads: 117
Joined: Dec 2002
Well, this is not really a newbie question...
If your question is if QBasic manages indexed files as did Locomotive Basic, the answer is no.
You would have to write the code to create the index files, sort them and search them. and probably the result would not be fast.
Ethan winer's book at
www.ethanwiner.com
has a complete chapter on managing databases with QB.
Antoni
Posts: 3,288
Threads: 167
Joined: Nov 2001
Yes, "Me and my Address book"
;*)
Check thi out, it indexes the random acces file and sorts it automatically.
http://relsoft.wrq.cjb.net/files/Address.bas
Posts: 2
Threads: 1
Joined: Feb 2003
I'm not a newbie to programming, but a newbie to Qbasic
Thanks for all your help
- Moz