L298N Motor Driver shield commands

Hello, I have probably a stupid question but today my brain it's weird!!! I have L298N Motor Driver shield on an Arduino Mega. Everything works but I need to make the code more simple. How I can shrink all these commands in one command to make my robot go forward?:

analogWrite (speedPinB, 255); 
    analogWrite (speedPinA, 255);
    digitalWrite (dir1PinA, LOW);
    digitalWrite (dir2PinA, HIGH);
    digitalWrite (dir1PinB, LOW);
    digitalWrite (dir2PinB, HIGH);

Like :

Forward = "all the code above"

Thanks

They're called "functions" - you've still got to write all that (once), but when you want to do it, it's just one line to call it.

Hi, would you please give me a fast small example?
I am looking for functions on Arduino website but I don’t see anything for that.
Thanks

would you please give me a fast small example?

void forward ()
{
  analogWrite (speedPinB, 255); 
  analogWrite (speedPinA, 255);
  digitalWrite (dir1PinA, LOW);
  digitalWrite (dir2PinA, HIGH);
  digitalWrite (dir1PinB, LOW);
  digitalWrite (dir2PinB, HIGH);
}

I am looking for functions on Arduino website but I don't see anything for that.

analogWrite is a function, digitalWrite is function...

I am looking for functions on Arduino website but I don't see anything for that.

Read this before posting a programming question

A C tutorial web site would teach you about functions.

thanks