Skip to content

Not all code paths return a value

Anthony Gordon

Asked Apr 5, 2009, 6:56 AM EDT2 answers
Share
LinkedInX
Hey guys, below is my code, and I keep getting an error message saying 'not all code paths return a value'. The error is coming from my method convertToMinutes(). Can anyone help me ? thanks

[code]
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private int convertToMinutes(int theValue)
        {
            return theValue;
        }



        private void button1_Click(object sender, EventArgs e)
        {
            int secondsInput;
            string minutesOutput;
            string hoursOutput;
        }


    }
}

[/code]

2 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    I don't see how... the first line of code in the function definition is a return statement.
    0
  • 0
    me either but i get the error and I cant compile it! Someone help!
    0