Help with Cosmos!!! Freaky occurence

Aug 23, 2010 at 9:43 AM

HELP!!!!!!!!!!!!!!!!!!!!! I have this code:

 

if (command == "create")                            

{                                

Console.Write("Name of file to create: ");                                

string create = Console.ReadLine();                                

if (!filenames.Contains(create) && filecounts == 1)                                

{                                    

Console.WriteLine(filecounts.ToString());                                    

Console.WriteLine(Int16.Parse(filecounts.ToString()));                                    

filecounts = Funcs.WriteFileToFS(create, "Empty File", Int16.Parse(filecounts.ToString()));

Console.WriteLine();

}                                

else                                

{                                    

Console.WriteLine("The file already exists!");                                    

Console.WriteLine();                                

}                            

}

 

where filenames is ArrayList=new ArrayList();

No matter what I set filecounts to, i still get 570512 when I write that value to the screen in numerical form. However, when I use ToString everything looks fine.

WHY!!!!!!!!???????????????

Coordinator
Aug 24, 2010 at 4:03 PM

Can you clarify which line of code is giving an unexpected output and what you expect it should be?

Aug 25, 2010 at 8:12 AM

the lines

Console.WriteLine(filecounts.ToString());                                    

Console.WriteLine(Int16.Parse(filecounts.ToString()));            

are erring out because i use filecounts in WriteFileToFS as the number of files for easy sorting later. anyways, when i use it like that, 

even though i have it set as a class variable and assigned it the value of 1 twice, it gives me IndexOutOfRange Exception because 

it turns out that filecounts was actually 570512. However, when I use filecounts.ToString, it displays one as it should. however,

when I use Int16.Parse (Which i am using because i believe you dont support Int32.Parse in MS4), it displays 570512.

 

WHY??????

 

Coordinator
Aug 25, 2010 at 8:33 AM
I doubt any of the Parse methods are implemented on MS4..



On Wed, Aug 25, 2010 at 9:12 AM, requimrar <notifications@codeplex.com> wrote:

From: requimrar

the lines

Console.WriteLine(filecounts.ToString());                                    

Console.WriteLine(Int16.Parse(filecounts.ToString()));            

are erring out because i use filecounts in WriteFileToFS as the number of files for easy sorting later. anyways, when i use it like that, 

even though i have it set as a class variable and assigned it the value of 1 twice, it gives me IndexOutOfRange Exception because 

it turns out that filecounts was actually 570512. However, when I use filecounts.ToString, it displays one as it should. however,

when I use Int16.Parse (Which i am using because i believe you dont support Int32.Parse in MS4), it displays 570512.

 

WHY??????

 

Read the full discussion online.

To add a post to this discussion, reply to this email (Cosmos@discussions.codeplex.com)

To start a new discussion for this project, email Cosmos@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Aug 25, 2010 at 9:21 AM
They Are!

-----------------------------------------------------------------
Thank you for helping us help you help us all.



On Wed, Aug 25, 2010 at 15:34, mterwoord <notifications@codeplex.com> wrote:

From: mterwoord

I doubt any of the Parse methods are implemented on MS4..



On Wed, Aug 25, 2010 at 9:12 AM, requimrar <notifications@codeplex.com> wrote:

From: requimrar

the lines

Console.WriteLine(filecounts.ToString());                                    

Console.WriteLine(Int16.Parse(filecounts.ToString()));            

are erring out because i use filecounts in WriteFileToFS as the number of files for easy sorting later. anyways, when i use it like that, 

even though i have it set as a class variable and assigned it the value of 1 twice, it gives me IndexOutOfRange Exception because 

it turns out that filecounts was actually 570512. However, when I use filecounts.ToString, it displays one as it should. however,

when I use Int16.Parse (Which i am using because i believe you dont support Int32.Parse in MS4), it displays 570512.

 

WHY??????

 

Read the full discussion online.

To add a post to this discussion, reply to this email (Cosmos@discussions.codeplex.com)

To start a new discussion for this project, email Cosmos@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Read the full discussion online.

To add a post to this discussion, reply to this email (Cosmos@discussions.codeplex.com)

To start a new discussion for this project, email Cosmos@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com