|
-
Nov 9th, 2000, 03:04 PM
#1
Thread Starter
Lively Member
I have questions for text files!
1. What are the major differences between Random and Binary. If using Random to manipulate as a database, how can I tell the number of records in a text file?
2. For Lock, what is SHARED, LOCK READ, LOCK WRITE, LOCK READ WRITE?
-
Nov 9th, 2000, 03:20 PM
#2
transcendental analytic
Random opens with fixed length records, and your file needs to be formatted according to a pattern. Using Binary you can read and write stuff more freely, put several headers, footers, and data suiting your needs.
Lock means when you open the file,
Shared > it can be opened by other open statements but not be deleted
Read > can't be read but written to
Write > can be read but not written to
read write, can't be opened at all.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Nov 9th, 2000, 04:07 PM
#3
I remember there was an article on this site about different access modes. I'll if I can find it for you.
-
Nov 9th, 2000, 04:34 PM
#4
Thread Starter
Lively Member
Thanks for going the distance Megatron. I wish I can help you guy back.
Kedaman, thanks for your effort. You explained alot of stuff to me in the past.
-
Nov 9th, 2000, 04:39 PM
#5
Thread Starter
Lively Member
How can I find the total number of records in an existing random file?
-
Nov 9th, 2000, 04:49 PM
#6
transcendental analytic
by integer division
Recs=lof(filenumber)/Reclen
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Nov 9th, 2000, 05:27 PM
#7
Thread Starter
Lively Member
Kedaman,
I am using this code right now. I is placing the next record on the same line. How can I make each record on a new line.
Dim LastRecord As Integer
Open "C:\HHH.txt" For Random Access Read Write As #1 Len = Len(MyWorker)
LastRecord = LOF(1) / Len(MyWorker) + 1
Put #1, LastRecord, MyWorker
-
Nov 9th, 2000, 06:21 PM
#8
transcendental analytic
i'm not sure if this works with random access, at least it does with binary, that it automatically moves the location one step forward and write the current record by omitting the record#
Put #1, , MyWorker
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Nov 9th, 2000, 09:11 PM
#9
Thread Starter
Lively Member
Is there a way to delete a record Kedaman?
-
Nov 9th, 2000, 09:36 PM
#10
transcendental analytic
Of course it is, but how hard depends on how you want to delete it.
1. just reset the record data
2. shuffle the following data one step left
3. move the last record into the just removed item.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|