Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
freefile to make appendable a random file?
#1
hy, i am trying to make a small database to practice, but i like to save a record in a file. for adding more file in the next time to open. my situation is that i used the free file to start in the next free record when add more record , but the new record delete the old record, not entire the file.

Code:
CLS
TYPE namestype
     nm AS STRING * 10
     ln AS STRING * 10
     age AS INTEGER
END TYPE
DIM names AS namestype
DIM fh AS INTEGER
fh = FREEFILE
recordlen# = LEN(names)
OPEN "stubase.dat" FOR RANDOM AS #fh LEN = recordlen#
5
INPUT "name: ", names.nm
INPUT "last name: ", names.ln
INPUT "age:", names.age
PUT #fh, , names
INPUT "any more data?", more$
       IF more$ = "y" GOTO 5 ELSE
CLOSE #fh
END

was is the best approach to make a file appendable and situable for a database, to editable the file and also, add more record.
thanks in advanced.
Reply


Messages In This Thread
freefile to make appendable a random file? - by guyisland - 07-10-2009, 02:31 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)