Type: Posts; User: Jim_Auricman
Search took 0.01 seconds.
April 23rd, 2015, 09:02 PM
Thanks, Arjay. I'll check into using a post build event, as that might be useful to do in some cases.
April 23rd, 2015, 12:36 PM
Thanks for your responses.
Each project has its own BIN directory. Using a Utility directory whose path is in the environment allows access more easily than specifying each project's BIN path when...
April 23rd, 2015, 09:44 AM
That's exactly what I do; The disadvantage is that when a new version of a Console application is made, the new version has to be re-copied to the utility folder.
"Utility folder that has a public...
April 23rd, 2015, 07:12 AM
The problem with using a shortcut to access a console application is that inputting parameters is problematic.
You can use Console.ReadLine() to input the parameters, but if you have 3 or 4...
April 22nd, 2015, 01:10 PM
I develop both Windows Forms and Console applications in C#.
The forms applications are easy to access by creating a shortcut on the desktop pointing to the executable file in one of the BIN...
July 17th, 2012, 03:17 PM
Coding standards were developed because frequently someone else will have to maintain your code, and having the code work will not necessarily make it understandable and maintainable. Using "break"...
July 16th, 2012, 08:20 PM
If you use the while statement as follows:
bool finished = false;
while ((!finished) && (!_backgroundWorker.CancellationPending))
//When the exit condition is met-
You just need 6 variables:
int con1 = rng.Next(0, 17);
int vo1 = rng.Next(0, 5);
int con2 = rng.Next(0, 17);
int vo2 = rng.Next(0,...
The code is doing what you told it to do in this statement:
Console.WriteLine(conlist[con] + volist[vo] + conlist[con] + volist[vo] + conlist[con] + volist[vo]);
since you are only using one index...
x = Console.ReadLine();
This line also needs to be within the do-while loop, otherwise x never gets updated.
int con = rng.Next(0, 21);
The conlist is only 17 elements, but con could be as large as 21, so eventually it may crash by being out of bounds.
January 3rd, 2012, 02:01 PM
I made a couple minor changes to your structure:
string eval = "";
bool finished = false;
December 15th, 2011, 02:24 PM
Believe it or not, I have seen code that used multiple entry into functions. Back in the days when code space and execution time was very critical, some functions were written with several different...
December 14th, 2011, 07:31 PM
"Yes, if you really want to avoid multiple returns then this is the way to do it. But it isn't as easy to read as the solution given by BioPhysEngr (with my correction). "
If you follow the coding...
December 14th, 2011, 02:53 PM
Here is another solution:
string stripZero(string OriginalNumStr)
string ModNumStr = OriginalNumStr;
int DotIndex = OriginalNumStr.IndexOf('.');
December 8th, 2011, 11:00 AM
You might want to try reading in using a BinaryReader and writing out using BinaryWriter.
BinaryReader r = new BinaryReader(fs);
binWriter = new...
December 5th, 2011, 03:32 PM
You didn't mention what the problem is, but
if (grade > 50)
GPA = 0.0;
so any grade above 50 will yield a GPA of 0.0. I don't think you want that.
December 3rd, 2011, 09:52 AM
No, you are not in the minority. If you make it a popularity contest, of course you will win.
People like to take the easy way out and don't care about who has to maintain their code later.
December 2nd, 2011, 08:02 PM
BPE, I have programmed using coding standards that strictly forbade the use of goto, continue and multiple returns from a function. I didn't write the standards, but I agreed with them and followed...
December 2nd, 2011, 10:26 AM
BPE, I share your aversion to goto, but I have a similar aversion to 'continue'. I have never used it, since it is easily avoided.
Assuming your code is correct (I haven't tested it), I have...
December 1st, 2011, 09:10 PM
You have guess defined as an int, but Console.ReadLine() returns a string. That is the mismatch. That's why I gave you this line:
string guess_str = Console.ReadLine();
Then you can convert it to...
December 1st, 2011, 01:04 PM
BioPhysEngr, I agree that using "goto" is a bad practice. But why do modern languages, including C#, allow its usage? It is an unnecessary statement so it shouldn't be included in the language.
November 30th, 2011, 06:19 PM
The guess string must be converted to an int before the comparison takes place.
Here are a few hints:
guess_str = Console.ReadLine();
November 17th, 2011, 04:18 PM
Vielleicht wenn Sie die Frage auf Englisch stellen würden, würde jemand verstehen und Ihnen helfen.
November 8th, 2011, 09:29 PM
I think you mean a wildcard "*.txt" rather than ".txt" in the Directory.GetFiles() function call.
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.