Avatar of Dovberman
DovbermanFlag for United States of America

asked on 

Error: Method Must Have a Return Type

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;
    }
ASP.NET.NET Programming

Avatar of undefined
Last Comment
Dovberman
Avatar of Jacques Bourgeois (James Burger)
Jacques Bourgeois (James Burger)
Flag of Canada image

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.
ASKER CERTIFIED SOLUTION
Avatar of dejaanbu
dejaanbu
Flag of Oman image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of pkbugudai
pkbugudai
Flag of India image

Dear!!!

1. go to menu bar -> build -> clean solution
2. rebuild solution
Avatar of Dovberman
Dovberman
Flag of United States of America image

ASKER

Thanks to all.  I will research this whan I return from a lunch appointment.
Avatar of Dovberman
Dovberman
Flag of United States of America image

ASKER

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,
Avatar of Dovberman
Dovberman
Flag of United States of America image

ASKER

Thanks.
.NET Programming
.NET Programming

The .NET Framework is not specific to any one programming language; rather, it includes a library of functions that allows developers to rapidly build applications. Several supported languages include C#, VB.NET, C++ or ASP.NET.

137K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo