Search Results - CodeGuru Forums
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: Jim_Auricman

Page 1 of 4 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    4
    Views
    488

    Re: Need help with very simple program!

    If you want it to recognize names not only 'Will', but containing "Will", like "Willster", etc., you can use 'Contain' rather than '=='.


    if (name.Contains("Will"))
    {
    ...
  2. Replies
    10
    Views
    613

    Re: Taking 1 method from another

    You can pass parameters by reference; that way you can declare the variable in the calling function and pass this same variable into both methods.


    public static void function(ref double x)
    ...
  3. Re: Saving Entire Projects in SharpDevelop

    The way I do this in Visual Studio is to save a template of the project I want to copy, then close the project and create a new project, importing the template of the old project, using a different...
  4. Replies
    3
    Views
    460

    Re: Creating arrays with a method

    Yes, you could pass the array size into the method as a value parameter.
    Loop as long as i < the array length, not i<= array length.
    To display the contents of the array, start with this line, then...
  5. Replies
    3
    Views
    460

    Re: Creating arrays with a method

    I see several problems with your method. In your 'for' loop, you are exceeding the bounds of the array. You are looping until i <= Array.Length; When you start with i = 0, you should run as long as i...
  6. Replies
    14
    Views
    856

    Re: Creating methods

    You got it. Good luck!
  7. Replies
    14
    Views
    856

    Re: Creating methods

    Yes, exactly. Look at the example that I posted. The Main method declares the variables and passes them into the method that does something with them and returns them.
  8. Replies
    14
    Views
    856

    Re: Creating methods

    Here is an example of a function (method) which uses reference Parameters:


    static void Get_Numbers(ref double D1, ref double D2, ref bool Success)
    // Practice of a function using...
  9. Replies
    14
    Views
    856

    Re: Creating methods

    You could display the result within the method instead of returning the result, but by returning it, the method is more generic thus being more useful than only displaying it when you calculate it....
  10. Replies
    14
    Views
    856

    Re: Creating methods

    The Math function is returning an integer, but you are not displaying it.
    Try adding code to display the result in Main before Console.ReadKey();, something like this:


    int...
  11. Replies
    8
    Views
    607

    Re: C# For Loop

    I usually prefer 'while' loops that exit when a flag is set, indicating that certain conditions have been met. For example,

    while(!done)
    {
    // do whatever needs to be done;
    // When condition(s)...
  12. Replies
    8
    Views
    607

    Re: C# For Loop

    The function is: private void button1_Click(object sender, EventArgs e)
    Outside the 'for' loop, add: label4.Text = "Value of i where there was a match, is ";
    Then inside the place where "if (die1...
  13. Replies
    8
    Views
    607

    Re: C# For Loop

    You won't see the display until the function exits.
    Using the debugger, I saw that the dies matched 16 times. Of course, each time the results may vary. If you execute label3.Text = ""; and...
  14. Replies
    10
    Views
    689

    Re: Beginner Needing Help with C# in VB

    static void Main(string[] args)
    {
    TestIfElse(10);-----------------------------------------------------------Why do I need the (10) here is I am declaring what numbers I am comparing to n in my next...
  15. Replies
    10
    Views
    689

    Re: Beginner Needing Help with C# in VB

    Yes, in Main 'n' isn't declared anywhere.
    I think your instructor wanted you to put the logic that you have in Main into the method that you created.
  16. Replies
    10
    Views
    689

    Re: Beginner Needing Help with C# in VB

    You will find that using methods instead of writing in-line code for everything you want to do is much easier to understand & follow, especially if someone else wrote the code and you are trying to...
  17. Replies
    10
    Views
    689

    Re: Beginner Needing Help with C# in VB

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;

    namespace ifelse_Statement1
    {
    class Program
    {
  18. Replies
    10
    Views
    689

    Re: Beginner Needing Help with C# in VB

    "I do not understand how you can add a second Method to the same class? "
    Take a look at the thread "Newb trying to learn C# / stuck".
    The sample program I added to the thread has several methods...
  19. Replies
    6
    Views
    528

    Re: Newb trying to learn C# / stuck

    It would be good if you would forget about using 'goto' if you want to write good code.
    I have rewritten your program to use functions instead of 'goto's.


    using System;
    using...
  20. Re: [RESOLVED] Accessing console applications from a command window

    Thanks, Arjay. I'll check into using a post build event, as that might be useful to do in some cases.
  21. Re: Accessing console applications from a command window

    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...
  22. Re: Accessing console applications from a command window

    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...
  23. Re: Accessing console applications from a command window

    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...
  24. [RESOLVED] Accessing console applications from a command window

    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...
  25. Re: using break statement in a while loop

    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"...
Results 1 to 25 of 90
Page 1 of 4 1 2 3 4


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a Codeguru.com survey!


HTML5 Development Center