Continuation Lines

Continuation Lines

Welcome to our Knowledge Base

Documentation | Blog | Demos | Support

< All Topics
Print

Continuation Lines

By default, a physical line end (carriage return at the command prompt or in an application program) terminates the statement on that line. Upon encountering the line end, the software processes the current statement. However, statements that are too long to fit on one physical line can be continued onto any number of physical lines.

The backslash ( – Escape) is used to signal the software that the current statement is incomplete and continues on the next physical line. In this circumstance, the backslash is called the continuation character.

The software handles the backslash as a continuation character depending on whether it appears outside or inside a quoted string.

Outside Quotation Marks

When the software encounters a backslash outside a quoted character string, it ignores any remaining characters on the current line and looks to the next physical line for the remainder of the statement. Processing does not begin until the software reaches the next physical line end (unless another unquoted backslash is encountered, as shown in the following example:

list all Employees where LastName = ‘Smith’
                   sorted by FirstName

Inside Quotation Marks

A backslash within a quoted string usually signals special treatment for the subsequent character(s). However, when the software encounters a quoted backslash as the last character before a physical line end, it assumes that the statement continues on the next physical line as shown in the following example:

list all Customers where City = ‘Los
Angeles’

The SET ESCAPECHAR Command

The SET ESCAPECHAR command is available to control how the backslash ( – Escape) is handled within quoted strings. Normally, the backslash is treated as an escape or continuation character when found inside quoted strings. By issuing a SET ESCAPECHAR OFF command, you cause the software to treat the backslash as text when it appears in quoted strings.

Was this article helpful?
0 out of 5 stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
5
How can we improve this article?
Please submit the reason for your vote so that we can improve the article.

Leave a Reply

Your email address will not be published. Required fields are marked *

en_CAEnglish