How to write multiline comments ?

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

If it’s not supported this should be removed from the documentation.

Here is the problem.

Message error: Unexpected token: Constant

DriNeo | 2016-03-08 16:38

:bust_in_silhouette: Reply From: volzhs

Comments

Anything from a # to the end of the line is ignored and is considered a comment.

# This is a comment
Multi-line comments can be created using “”” (three quotes in a row) at the beginning and end of a block of text.

""" Everything on these
lines is considered
a comment """

You tested it ?

DriNeo | 2016-03-08 16:36

I am using it often.
This is actually how to make multi-line string.
so, there will be an error if use it outside of func
you can use it only inside func

volzhs | 2016-03-08 16:47

Thanks for these informations.

As you know real comments are ignored by the interpreter or compiler and you can write them everywhere so these additional information is necessary to simulate multiline comments.

It’s unfortunate because I wanted to write a little text on top of my scripts…

DriNeo | 2016-03-08 16:58

Open an issue then?

Bojidar Marinov | 2016-03-08 18:40

@Bojidar There’s already two issues opened on Github. It seems this feature doesn’t attract people.

DriNeo | 2016-03-08 20:51

:bust_in_silhouette: Reply From: YeOldeDM

You can select the lines you want to comment out and hit ctrl+k to comment/uncomment them.

“”" is misleading, as it looks like a comment in the script editor. Text in triple-quotes are multi-line strings. The documentation should be changed, as well as the color-coding of the syntax in the editor.

Very useful ! Thanks to all !

DriNeo | 2016-03-08 20:52