Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > BOOK: Beginning Visual C#
|
BOOK: Beginning Visual C#
This is the forum to discuss the Wrox book Beginning Visual C#, Revised Edition of Beginning C# for .NET v1.0 by Karli Watson, David Espinosa, Zach Greenvoss, Jacob Hammer Pedersen, Christian Nagel, Jon D. Reid, Matthew Reynolds, Morgan Skinner, Eric White; ISBN: 9780764543821
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Visual C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 14th, 2003, 05:31 AM
Registered User
 
Join Date: Aug 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Bug in SimpleFileEditor - making file smaller does

Is there a bug in the SimpleFileEditor related to opening a file, making it smaller ( by deleting some of the text) and then doing a file save?

On my machine, the resulting file (as viewed with Notepad) still contains the original text beyond the length of the last file save.

here is an example:

open a file containg three lines:
 aaa
 bbb
 ccc

change the first line to "xxx" and delete the third line
now the edit box looks like:
 xxx
 bbb

do a file save

open the file with notepad. the file has three lines:
 xxx
 bbb
 ccc

I cannot figure out what the problem is. I am using the source code downloaded from this site.


 
Old September 15th, 2003, 08:38 PM
Authorized User
 
Join Date: Jun 2003
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to HuhOiC
Default

I don't have the book, so I'm not quite sure what it should be doing. But after the changes made does it save the changes in the right area back to the file? Like from the text property of the textbox control or from a saved string or a string array or wherever those changes are? Are there any other changes made before it saves. To me it looks like it recognizes the changes made but add's ccc to the last line or is never deleted. Ohhhhh I know what else it could be. You might want to, when opening the file, open it as create/new, or else it will just overwrite existing data, or append to it. That might be what's going on. Check on that. Just look at the FileMode properties when opening it, when creating a file data type. =)


RAyRAy
Huh O i C

Program or Be Programmed!!!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Making an Excel File expire kklassen VB How-To 1 February 4th, 2008 05:45 PM
Making an Alteration to an VB Codebehind file Nostromo77 ASP.NET 2.0 Basics 4 April 24th, 2007 08:11 PM
Bug or no to bug learning C using VS.Net to compil tesh All Other Wrox Books 0 February 14th, 2007 01:06 PM
Smaller download/single download file available jminatel BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 0 November 21st, 2005 11:10 AM
Suggestion... smaller [code] size nikolai Forum and Wrox.com Feedback 1 September 18th, 2003 03:16 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.