Help with an if statement based on an output terminal

I'm trying to create code that will do an action when an output terminal is set to HIGH or LOW.

my example of code is here

case '7': if (12, HIGH)) { NewTone (13, 262, 250); ++point; Reset(y); } break;

I only know how to use functions such as digitalWrite(12, High) or pinMode(A1, output) and was wondering if there was a function that can check to see whether its set to high or low and if it can be used in an if statement.

Read the documentation for DigitalRead

int ledPin = 13; // LED connected to digital pin 13
int inPin = 7;   // pushbutton connected to digital pin 7
int val = 0;     // variable to store the read value

void setup()
{
  pinMode(ledPin, OUTPUT);      // sets the digital pin 13 as output
  pinMode(inPin, INPUT);      // sets the digital pin 7 as input
}

void loop()
{
  val = digitalRead(inPin);   // read the input pin
  digitalWrite(ledPin, val);    // sets the LED to the button's value
}

You don’t Need a function. “If” is a Statement of ist own.

if (l2 == HIGH)
{ dothis();
andthis();
}
else
{ l2isnothigh();
sodosomethingelse();
}

alternatively, you can use if (ls) without the == HIGH in this case. It’s Kind of like saying if (true) vs if (true == true).

I have tried the if (12 ==HIGH) and it wasnt working properly. The body of the if statement would run regardless of whether the LED was on HIGH or LOW.

if (digitalRead(12) == HIGH)
{
  //run the code between the braces
}