Line Continuation

From Xojo Documentation

Method

The underscore character, "_", is used as the line continuation character to indicate that a line of code is being continued on the next printed line of text in the Code Editor.

Usage

_ (used as the last character in a line)

Notes

Use the underscore character as the last character in a printed line of text in the Code Editor to indicate that you are continuing the line of code on the next printed line in the Code Editor. The compiler will then treat the second printed line as a continuation of the first line. When you use the _ keyword, the Code Editor indents the next line automatically, as is shown in the example.

If you need to break up a text string into two lines in the Code Editor, place the _ keyword outside the quoted string, as in the example.

To enter the _ character and move to the next line, press Ctrl+Enter on Windows and Linux; on Macintosh, press Option-Return.

Sample Code

The following example uses the line continuation character to break a long string into two lines in the Code Editor. The _ keyword is used outside the quoted string and the + operator concatenates the two strings.

Var SaveChangesDialog As New MessageDialog
SaveChangesDialog.Explanation = "Hint: If you don't save, you will " _
+ "lose your work since your last Save."