How do I split an "if" statement over several lines?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Calinou
:warning: Old Version Published before Godot 3 was released.

I want to write an if statement that spans over several lines, how do I do that?

:bust_in_silhouette: Reply From: Calinou

You can use parentheses around the if statement, or backslashes before the newline (which should work anywhere).

Take this script for example:

func _ready():
    if (2 == 2
        and 3 == 3
        and 4 == 4
        and 5 == 5
        and 6 == 6):
            print("The parenthesis way of putting 'if' statements on multiple lines.")

    if 2 == 2 \
        and 3 == 3 \
        and 4 == 4 \
        and 5 == 5 \
        and 6 == 6:
            print("The backslash way of putting 'if' statements on multiple lines.")