|
-
Sep 25th, 2000, 07:21 AM
#1
transcendental analytic
Iain, ok you seem to be one step ahead me, the processor which usually has nothing to do, could do something while waiting for information, but i'm almost sure this won't work in VB since it doesn't support multithreading. It will actually do everything step by step, reading the chunk, then compare it, harddisk does nothing, and then read again, so actually i'm suggesting it would be slower to read in chunks. Of course this is just a guess.
Now Instr is a slower method than i don't remember what it was, i guess i have to get back to my own computer and check that out, but there is a lot faster method.
I'm not sure, you might be right with the Byval thing, but from what i've heard Byval is faster than Byref.
Code:
X=instr(Buffer,vbcrlf)
Do While X
X=instr(X+1,Buffer,vbcrlf)
Lines=Lines+1
Loop
Now simple line counting, this is for Pentax, using slow instr, you do for strings or string properties like Richtext.text, just replace buffer with that.
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
|