Hi Thomas,

As I do not create classes or anything like that, a simple text file is the 
easiest way to write and retrieve data, it is just

Open "homer.cfg" For Output As #1
Print #1, nv(1)
Close #1

Open "homer.cfg" For Input As #1
Input #1, nv(1)
Close #1

or like
Open "homerrec.txt" For Output As #1
Print #1, " Homer on a Harley  record file  By Jim Kitchen "
tp$ = " Record number of buses jumped successfully"
tp$ = tp$ + Str$(sbj)
Print #1, tp$
tp$ = " on " + Date$
Print #1, tp$
tp$ = " By " + r$
Print #1, tp$
Close #1

But for binary files there is more to it, like building strings etc because you 
can not just write a string to or in a binary file.

Open "homer.rec" For Binary Access Read As #1
Get #1, , rnb
Get #1, , lorn
For x = 1 To lorn
Get #1, , ln
rn$ = rn$ + Chr$(ln)
Next x
Get #1, , RecMonth
Get #1, , RecDay
Get #1, , RecYear
Close #1

Open "homer.rec" For Binary Access Write As #1
Put #1, , sbj
lorn = Len(r$)
Put #1, , lorn
For x = 1 To lorn
ln = Asc(Mid$(r$, x, 1))
Put #1, , ln
Next x
dt$ = Date$
RecMonth = Val(Mid$(dt$, 1, 2))
RecDay = Val(Mid$(dt$, 4, 2))
RecYear = Val(Mid$(dt$, 7, 4))
Put #1, , RecMonth
Put #1, , RecDay
Put #1, , RecYear
Close #1

But I go through the hassle of binary files so that one can not as easily edit 
the record files etc.

BFN

    Jim

Binary Choir = 1”1”1”1”1”1”1”1”1

j...@kitchensinc.net
http://www.kitchensinc.net
(440) 286-6920
Chardon Ohio USA
---
Gamers mailing list __ Gamers@audyssey.org
If you want to leave the list, send E-mail to gamers-unsubscr...@audyssey.org.
You can make changes or update your subscription via the web, at
http://audyssey.org/mailman/listinfo/gamers_audyssey.org.
All messages are archived and can be searched and read at
http://www.mail-archive.com/gamers@audyssey.org.
If you have any questions or concerns regarding the management of the list,
please send E-mail to gamers-ow...@audyssey.org.

Reply via email to