'void' function as a 'if' variable

Hi guys,

Is it possible to have a void function as a 'if' variable.

for example

void setup ()

void mainMenu()
{
lcd.setCursor(0,0);
lcd.print("Main Menu");
lcd.setCursor(0,1);
lcd.write(Symbol_1);
lcd.setCursor(2,1);
lcd.print("Pump 1");
lcd.setCursor(0,2);
lcd.write(Symbol_1);
lcd.setCursor(2,2);
lcd.print("Pump 2");
lcd.setCursor(0,3);
lcd.write(Symbol_1);
lcd.setCursor(2,3);
lcd.print("Set Schedule");
lcd.setCursor(10,1);
lcd.write(Symbol_1);
lcd.setCursor(12,1);
lcd.print("Pump 3");
}

void loop ()
{
if (mainMenu == HIGH)
{
//then carry out x protocol
}
}

cheers guys,
Jon

No.
"void" says the function returns no value when called.
You're not calling the function anyway.

It's difficult to see what that function could return.

If the function returns something then yea, but not as a void or the way you have it.

void setup()
{
  Serial.begin(115200);

  for( byte idx = 0; idx < 10; idx++)
  {
    Serial.print("At index: "); Serial.print(idx); 
    if( foo( idx ) == true)
    {
      Serial.println(", it was TRUE");
    }
    else 
    {
      Serial.println(", it was FALSE");
    }
  }
}

void loop() {/* not being used */ }

boolean foo(byte x)
{
  if(x > 4 && x < 7)
    return true;
  else 
    return false;
}
boolean foo(byte x)
{
  return (x > 4 && x < 7);
}

I wanted to expand it, so Junblud could see what was happening.