|
-
Sep 28th, 2000, 10:14 AM
#1
Thread Starter
Addicted Member
Hello!
I use Hoffman algorithm to compress string. It adds vbCr at the beginning of compressed string's header. Then I want to load that string from file. In notepad I see all text in one line so I used Line Input # statement. But I realised that I was wrong, because Line Input accepts vbCr as enter (new line), so it ends here even if it has read just 2 charachters.
How can I read whole line without using Line Input # statement which doesn't work?
Zvonko Bostjancic
Ilirska Bistrica, Slovenia
[email protected]
Using VS6 Professional with SP3
Programming mostly in VB and I've started to learn VC++ & MFC
-
Sep 28th, 2000, 10:18 AM
#2
Thread Starter
Addicted Member
Just adding:
In compressed string are also vbLf constants - Chr(13) and these are also supposed to be new line (for VB).
The thing I need is that then new line can be there where are both characters (vbCrLf).
Looping through all file, finding it, retrieveing it and decompressing would be useless (100k file) and it would take a long time. Any suggestions?
Zvonko Bostjancic
Ilirska Bistrica, Slovenia
[email protected]
Using VS6 Professional with SP3
Programming mostly in VB and I've started to learn VC++ & MFC
-
Sep 28th, 2000, 12:09 PM
#3
fyi:
vbLF = chr(10), not 13!
-
Sep 28th, 2000, 12:32 PM
#4
Guru
Just read the entire file into a string. 
Code:
Dim sFile As String, btFileNum As Byte
btFileNum = FreeFile
Open "C:\A\B\C\D\E\F.G" For Input As btFileNum
sFile = Input(LOF(btFileNum), btFileNum)
Close btFileNum
' Now, the string sFile contains the entire contents of the file
-
Sep 28th, 2000, 12:38 PM
#5
Thread Starter
Addicted Member
And if I read all file to string, then I can split it, isn't that right?
Zvonko Bostjancic
Ilirska Bistrica, Slovenia
[email protected]
Using VS6 Professional with SP3
Programming mostly in VB and I've started to learn VC++ & MFC
-
Sep 28th, 2000, 12:41 PM
#6
-
Sep 28th, 2000, 01:07 PM
#7
_______
<?>
You can if you have somthing to split on.
Split() Function in VB
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
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
|