Power to Build

Home » CodeProject » Quick Tip: Line continuation Char in code

Quick Tip: Line continuation Char in code

In English, we use sentences that are made up of words which are typically separated by spaces (” “) and tabs. We use commas, and semi-colons to create pauses and we keep reading until we see a period. If the sentence is too long to fit on a line (typically 72 – 80 characters on a page). Often times, we feel the need to break in the middle of a word, to keep the right margin neat. For this we use hyphen (“-“).

Programming languages and scripts are not very different. After all, they are made by us, humans. Each language has a set of punctuations like English. As for wrapping a statement onto next line, each language may have it’s own character and conventions. In any case, you cannot break in the middle of a word.

Generally, Microsoft programs and script use hyphen (“-“) to indicate the statement is continuing on the next line. Unix world typically use a backslash (“\”).

 

Language

Character

English

DOS/Windows Batch File

^, (

C, C++

\

FORTRAN

&

SQL*Plus

Python

\

VB

_

 

 

 

See this wiki post for more on this and other punctuation in programs.


Comments, please?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: