Error: Method Must Have a Return Type

Dovberman
Dovberman used Ask the Experts™
on
I am trying to write a simple procedure.
The following should be simple, but I am getting a compile error.
What do I need to change?
Thanks,

Boolean blnIsOK;
    short intSizeA = 12;
    short intSizeB = 12;
    blnIsOK = StartCalcs(intSizeA,intSizeB);  //Error: Method Must Have a Return Type

    protected Boolean StartCalcs(short pintSizeA,short pintSizeB)
    {
        Boolean blnOK = true;
 
        return blnOK;
    }
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2015

Commented:
Where is the first block of code in relation to the method? In the same class or somewhere else?

If not, there might be another method with the same name but declared with void in the class that is calling the method. Right click on the call and GoTo definition to see where it leads you.
Commented:
you should call

blnIsOK = StartCalcs(intSizeA,intSizeB);  

inside a procedure/function or inside an event. you cannot call outside , as the compiler won't know when to execute this procedure call.
Dear!!!

1. go to menu bar -> build -> clean solution
2. rebuild solution
Fundamentals of JavaScript

Learn the fundamentals of the popular programming language JavaScript so that you can explore the realm of web development.

Author

Commented:
Thanks to all.  I will research this whan I return from a lunch appointment.

Author

Commented:
I needed an event.

  protected void cmdMannWhitney_Click(object sender, EventArgs e)
    {
        short intSizeA = 12;
        short intSizeB = 12;
        bool blnOK = StartCalcs(intSizeA, intSizeB);
        double dblS = Math.Sqrt(24);
        int MinVal = Math.Min(12, 14);
    }

Thanks,

Author

Commented:
Thanks.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial