PDA

View Full Version : Multiline Strings


codefox
12-01-2002, 11:39 AM
Got used to programming in PHP where I almost always store a query as

$sSQL = <<<SQL
SELECT a, b, c
FROM Whatevertable
WHERE a = 123
SQL;

Is there a way in VBScript or JScript to break strings to multiple lines? Or do you have any good ideas for multiline strings?

codefox
12-01-2002, 11:41 AM
Well, I know that could be done in VBscript by appending "& _" at the end of each line to continue a string to the next line, but is there a better way?

Mhtml
12-01-2002, 12:56 PM
a = "blah blah blah"
a = a & "blah blah blah"

whammy
12-02-2002, 02:14 AM
Either way works...

You know how in javascript you can use +=, -=, etc. as a shortcut for the above syntax? Finally MS got the picture and stuff like:

&=

works in VB.NET. Yay.

Now if I can just figure out how to keep <form runat="server">
from inserting a "name" attribute into the form tag in the HTML output, it will quit nagging me (since the name attribute is deprecated in XHTML)...