Did you ever have a really long line of code to write and get sick of
scrolling left and right trying to read it? Well VBScript has this neat
little invention that makes that really unnecesary. It's called the
line continuation character and it's simply an underline ( _ ).
It allows you to nicely split your lines into a more manageable form.
Instead of:
strSQL = "SELECT field FROM table WHERE field = 'value' ORDER BY field ASC"
You could just as easily use:
strSQL = "SELECT field " _
& "FROM table " _
& "WHERE field = 'value' " _
& "ORDER BY field ASC"
Both of the above will acheive the same result, but the second one
will keep your neck from getting sore from looking back and forth.
(Ok... so I'm exagerating this simple and relatively short-lined example a little, but you get the point.)
If you have a tip you would like to submit, please send it to:
webmaster@asp101.com.