_ (keyword)

Syntax

s$ = "This is a very long line that I want to split " & _
  "onto two lines"

Description

Line-continuation character, which allows you to split a single script onto more than one line.

Comments

The line-continuation character cannot be used within strings and must be preceded by white space (either a space or a tab).

The line-continuation character can be followed by a comment, as shown below:

  i = 5 + 6 & _   'Continue on the next line.
    "Hello"

Example

Const crlf = Chr$(13) + Chr$(10)

Sub Main()
  'The line-continuation operator is useful when concatenating
  'long strings.

  msg1 = "This line is a line of text that" & crlf & "extends beyond " _
      & "the borders of the editor" & crlf & "so it is split into " _
      & "multiple lines"

  'It is also useful for separating and continuing long calculation lines.

  b# = .124
  a# = .223
  s# = ( (((Sin(b#) ^ 2) + (Cos(a#) ^ 2)) ^ .5) / _
       (((Sin(a#) ^ 2) + (Cos(b#) ^ 2)) ^ .5) ) * 2.00
    MsgBox msg1 & crlf & crlf & "The value of s# is: " & s#
End Sub

More information

Symbols