Click here to Skip to main content
15,901,035 members
Home / Discussions / C#
   

C#

 
GeneralRe: New to C# Programming Pin
George L. Jackson25-Aug-07 3:12
George L. Jackson25-Aug-07 3:12 
Question(nOOb help) comparing ArrayLists of structs.. Pin
Dio2224-Aug-07 9:43
Dio2224-Aug-07 9:43 
AnswerRe: (nOOb help) comparing ArrayLists of structs.. Pin
ghle24-Aug-07 11:08
ghle24-Aug-07 11:08 
AnswerRe: (nOOb help) comparing ArrayLists of structs.. Pin
Luc Pattyn24-Aug-07 13:37
sitebuilderLuc Pattyn24-Aug-07 13:37 
QuestionHow do I incorporate these two routines? Pin
solutionsville24-Aug-07 9:21
solutionsville24-Aug-07 9:21 
AnswerRe: How do I incorporate these two routines? Pin
Hessam Jalali24-Aug-07 9:55
Hessam Jalali24-Aug-07 9:55 
AnswerRe: How do I incorporate these two routines? Pin
solutionsville24-Aug-07 10:16
solutionsville24-Aug-07 10:16 
AnswerRe: How do I incorporate these two routines? Pin
Big Daddy Farang24-Aug-07 12:37
Big Daddy Farang24-Aug-07 12:37 
solutionsville wrote:
or am I out of my mind.

Nothing here leads me to that conclusion. Big Grin | :-D

If I understand correctly what you mean by incorporating the two routines, you might be able to do something like this.
StringCollection ReadFileIntoStringCollection()
{
	const int MaxBytes = 65536;
	StreamReader sr = new StreamReader ( chosenFile );
	StringCollection result = new StringCollection();
	int nBytesRead = 0;
	string nextLine;
	while ( ( nextLine = sr.ReadLine() ) != null )
	{
		nBytesRead += nextLine.Length;
		if ( nBytesRead > MaxBytes )
			break;
		// copy and paste the guts of LayoutInput to here
		// instead of returning sb.ToString() do
		// result.Add ( sb.ToString() ) ;
		result.Add ( nextLine );
	}
	sr.Close();
	return result;
}

When I say "guts" I mean leave out the first few lines, start with the declaration of sb and go through the end of the while loop. Once you do that there may be some compilation errors or warnings to fix, but I think it should work. Or can be made to work.

Hope that's more or less what you had in mind.


BDF
AnswerRe: How do I incorporate these two routines? [modified] Pin
solutionsville24-Aug-07 17:54
solutionsville24-Aug-07 17:54 
GeneralRe: How do I incorporate these two routines? Pin
Big Daddy Farang27-Aug-07 10:03
Big Daddy Farang27-Aug-07 10:03 
AnswerRe: How do I incorporate these two routines? Pin
solutionsville27-Aug-07 12:32
solutionsville27-Aug-07 12:32 
GeneralRe: How do I incorporate these two routines? Pin
Big Daddy Farang27-Aug-07 12:39
Big Daddy Farang27-Aug-07 12:39 
Questiongetting infragistics Pin
starist24-Aug-07 9:12
starist24-Aug-07 9:12 
AnswerRe: getting infragistics Pin
Alaric_24-Aug-07 9:27
professionalAlaric_24-Aug-07 9:27 
GeneralRe: getting infragistics Pin
Dan Neely24-Aug-07 10:06
Dan Neely24-Aug-07 10:06 
QuestionI need a full stop Pin
humayunlalzad24-Aug-07 8:41
humayunlalzad24-Aug-07 8:41 
AnswerRe: I need a full stop Pin
PIEBALDconsult24-Aug-07 9:04
mvePIEBALDconsult24-Aug-07 9:04 
GeneralRe: I need a full stop Pin
Alaric_24-Aug-07 9:05
professionalAlaric_24-Aug-07 9:05 
AnswerRe: I need a full stop Pin
Alaric_24-Aug-07 9:04
professionalAlaric_24-Aug-07 9:04 
AnswerRe: I need a full stop Pin
PIEBALDconsult24-Aug-07 11:58
mvePIEBALDconsult24-Aug-07 11:58 
GeneralRe: I need a full stop Pin
martin_hughes24-Aug-07 11:49
martin_hughes24-Aug-07 11:49 
GeneralRe: I need a full stop Pin
humayunlalzad24-Aug-07 14:55
humayunlalzad24-Aug-07 14:55 
GeneralRe: I need a full stop Pin
PIEBALDconsult24-Aug-07 18:42
mvePIEBALDconsult24-Aug-07 18:42 
QuestionHELP WITH SKYNET!!! Pin
Alaric_24-Aug-07 8:30
professionalAlaric_24-Aug-07 8:30 
AnswerRe: help help help Pin
Alaric_24-Aug-07 8:34
professionalAlaric_24-Aug-07 8:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.