|
-
Sep 25th, 2000, 03:01 AM
#1
Thread Starter
Hyperactive Member
Why do I get a different result from these two operations?
Code:
Open sTxtFile For Input As iFile
frmMain.txtMandates.Text = Trim(Input(LOF(iFile), iFile))
Close #iFile
Open sTxtFile For Input As iFile
Do While Not EOF(iFile)
Line Input #iFile, sTemp
lCount = lCount + 1
Loop
Close #iFile
Gives 297 and is correct, but
Code:
lCount = SendMessage(ByVal frmMain.txtMandates.hwnd, EM_GETLINECOUNT, 0, 0)
Gives me 298.
I would prefer to use the API call on the text box to do this, but if this is inaccurate I can't.
Regards
-
Sep 25th, 2000, 06:26 AM
#2
The reason is probably because of an extra line.
Try testing it, load the file, see how many lines you have (298), than go to the end of the text file and erase the extra line. It should now be 297. That's just my $0.02.
-
Sep 25th, 2000, 07:42 AM
#3
PowerPoster
There's probably a blank line at one end or other of the text file.
This was likely removed when you trimmed it as you imported it into the textbox.
If you figure it out, lets us know what the solution was please...
Gentile or Jew,
O you who turn the wheel and look to windward,
Consider Phlebas, who was once handsome and tall as you...
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
|