<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Embed Code and Avoid Underscores in Your Multiline Strings </title><link>http://blogs.msdn.com/bethmassi/archive/2007/10/23/avoid-underscores-in-your-multiline-strings.aspx</link><description>One of the things I most dearly missed from FoxPro when I moved to VB.NET was the ability to easily dump a bunch of text (multi-line string literals) into the editor easily and embed code (text-merge). FoxPro has a keyword TEXT...ENDTEXT for this and</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: Embed Code and Avoid Underscores in Your Multiline Strings </title><link>http://blogs.msdn.com/bethmassi/archive/2007/10/23/avoid-underscores-in-your-multiline-strings.aspx#5631972</link><pubDate>Tue, 23 Oct 2007 23:41:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5631972</guid><dc:creator>Josh Stodola</dc:creator><description>&lt;p&gt;I have rug burn on my chin because of this post!&lt;/p&gt;
&lt;p&gt;I simply can NOT wait for the release, this is gonna be so awesome.&lt;/p&gt;
</description></item><item><title>re: Embed Code and Avoid Underscores in Your Multiline Strings </title><link>http://blogs.msdn.com/bethmassi/archive/2007/10/23/avoid-underscores-in-your-multiline-strings.aspx#5633402</link><pubDate>Wed, 24 Oct 2007 00:39:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5633402</guid><dc:creator>Beth Massi</dc:creator><description>&lt;p&gt;Josh,&lt;/p&gt;
&lt;p&gt;LOL! You can give it a try right now (Beta 2) if you have an extra machine or Virtual Machine laying around: &lt;a rel="nofollow" target="_new" href="http://msdn2.microsoft.com/en-us/vstudio/aa700831.aspx"&gt;http://msdn2.microsoft.com/en-us/vstudio/aa700831.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;And congrats on starting your blog! ;-)&lt;/p&gt;
</description></item><item><title>re: Embed Code and Avoid Underscores in Your Multiline Strings </title><link>http://blogs.msdn.com/bethmassi/archive/2007/10/23/avoid-underscores-in-your-multiline-strings.aspx#5650330</link><pubDate>Wed, 24 Oct 2007 16:53:55 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5650330</guid><dc:creator>Josh Stodola</dc:creator><description>&lt;p&gt;I'd love to give it a try but I dont an extra machine laying around. &amp;nbsp;Ok, well I do, but it is an antique unworthy of any version of VS!!&lt;/p&gt;
&lt;p&gt;Thanks :)&lt;/p&gt;
&lt;p&gt;I might ask around at work and see if there is a &amp;quot;playground&amp;quot; machine I can have for a while.&lt;/p&gt;</description></item><item><title>re: Embed Code and Avoid Underscores in Your Multiline Strings </title><link>http://blogs.msdn.com/bethmassi/archive/2007/10/23/avoid-underscores-in-your-multiline-strings.aspx#5652266</link><pubDate>Wed, 24 Oct 2007 18:50:32 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5652266</guid><dc:creator>Billy Hollis</dc:creator><description>&lt;p&gt;Beth, I'm stealing, er, uh, borrowing some of these examples for my &amp;quot;What's new in VB9&amp;quot; talk at DevConnections Las Vegas. Your name will be mentioned prominently.&lt;/p&gt;
</description></item><item><title>re: Embed Code and Avoid Underscores in Your Multiline Strings </title><link>http://blogs.msdn.com/bethmassi/archive/2007/10/23/avoid-underscores-in-your-multiline-strings.aspx#5652579</link><pubDate>Wed, 24 Oct 2007 19:08:28 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5652579</guid><dc:creator>Beth Massi</dc:creator><description>&lt;p&gt;Hi Billy!,&lt;/p&gt;
&lt;p&gt;For you, anything! ;-) Ping me directly if you need any more demos, decks, etc. I'll be speaking at Silicon Valley code-camp this weekend and then QCon in SF Nov 9th so I've pulling demos together this week. &lt;/p&gt;
&lt;p&gt;-B&lt;/p&gt;
</description></item><item><title>VB9 XML Literals</title><link>http://blogs.msdn.com/bethmassi/archive/2007/10/23/avoid-underscores-in-your-multiline-strings.aspx#5662122</link><pubDate>Thu, 25 Oct 2007 09:47:40 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5662122</guid><dc:creator>Manos Kelaiditis' Weblog</dc:creator><description>&lt;p&gt;Ένα από τα νέα χαρακτηριστικά της VB.NET είναι η υποστήριξη XML Literals. Πρόκειται για τη δυνατότητα&lt;/p&gt;
</description></item><item><title>XML Literals Tips/Tricks </title><link>http://blogs.msdn.com/bethmassi/archive/2007/10/23/avoid-underscores-in-your-multiline-strings.aspx#5695402</link><pubDate>Fri, 26 Oct 2007 23:09:45 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5695402</guid><dc:creator>Beth Massi - Sharing the goodness that is VB</dc:creator><description>&lt;p&gt;A couple quick tips here when using XML literals in your Visual Basic programs. #1: I've started using&lt;/p&gt;
</description></item><item><title>re: Embed Code and Avoid Underscores in Your Multiline Strings </title><link>http://blogs.msdn.com/bethmassi/archive/2007/10/23/avoid-underscores-in-your-multiline-strings.aspx#5707273</link><pubDate>Sat, 27 Oct 2007 12:19:14 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5707273</guid><dc:creator>Sven Groot</dc:creator><description>&lt;p&gt;Hi Beth,&lt;/p&gt;
&lt;p&gt;XML literals are one of my favourite new features in VB9, really looking forward to using this in a real product.&lt;/p&gt;
&lt;p&gt;I'm not sure I like it for multiline strings though, because of the break in indentation. It's still a pretty cool idea though. :)&lt;/p&gt;
</description></item><item><title>New Visual Basic LINQ to XML Videos Released! (Beth Massi)</title><link>http://blogs.msdn.com/bethmassi/archive/2007/10/23/avoid-underscores-in-your-multiline-strings.aspx#5818781</link><pubDate>Thu, 01 Nov 2007 22:08:50 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5818781</guid><dc:creator>The Visual Basic Team</dc:creator><description>&lt;p&gt;We just released a new set of How-Do-I videos in our LINQ series on LINQ to XML in Visual Basic. These&lt;/p&gt;
</description></item><item><title>New Visual Basic LINQ to XML Videos Released!</title><link>http://blogs.msdn.com/bethmassi/archive/2007/10/23/avoid-underscores-in-your-multiline-strings.aspx#5838980</link><pubDate>Fri, 02 Nov 2007 19:02:42 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5838980</guid><dc:creator>Beth Massi - Sharing the goodness that is VB</dc:creator><description>&lt;p&gt;We just released a new set of How-Do-I videos in our LINQ series on LINQ to XML in Visual Basic. These&lt;/p&gt;
</description></item><item><title>Mail Merging with Word, LINQ and XML Literals in VB</title><link>http://blogs.msdn.com/bethmassi/archive/2007/10/23/avoid-underscores-in-your-multiline-strings.aspx#6687801</link><pubDate>Fri, 07 Dec 2007 05:26:51 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6687801</guid><dc:creator>Beth Massi - Sharing the goodness that is VB</dc:creator><description>&lt;p&gt;I've mentioned before that you can use XML literals in VB 9 to do text merging so I figured it should&lt;/p&gt;
</description></item><item><title>Mail Merging with Word, LINQ and XML Literals in VB</title><link>http://blogs.msdn.com/bethmassi/archive/2007/10/23/avoid-underscores-in-your-multiline-strings.aspx#6688011</link><pubDate>Fri, 07 Dec 2007 06:01:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6688011</guid><dc:creator>Noticias externas</dc:creator><description>&lt;p&gt;I&amp;amp;#39;ve mentioned before that you can use XML literals in VB 9 to do text merging so I figured it should&lt;/p&gt;
</description></item><item><title>Using XML Literals in Code Generation</title><link>http://blogs.msdn.com/bethmassi/archive/2007/10/23/avoid-underscores-in-your-multiline-strings.aspx#7622138</link><pubDate>Tue, 12 Feb 2008 01:06:22 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7622138</guid><dc:creator>Noticias externas</dc:creator><description>&lt;p&gt;A while back I showed a very simple way you could use XML Literals to generate code. In my previous life&lt;/p&gt;
</description></item><item><title>re: Embed Code and Avoid Underscores in Your Multiline Strings </title><link>http://blogs.msdn.com/bethmassi/archive/2007/10/23/avoid-underscores-in-your-multiline-strings.aspx#8471737</link><pubDate>Thu, 08 May 2008 16:18:32 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8471737</guid><dc:creator>Nishtha</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Can you please let us know if VB can read a text file of around 90 MB file size and process relevant data out of it.&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;Nishtha&lt;/p&gt;
</description></item><item><title>re: Embed Code and Avoid Underscores in Your Multiline Strings </title><link>http://blogs.msdn.com/bethmassi/archive/2007/10/23/avoid-underscores-in-your-multiline-strings.aspx#9180318</link><pubDate>Fri, 05 Dec 2008 19:24:39 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9180318</guid><dc:creator>Robin Lewis</dc:creator><description>&lt;p&gt;So why did it take Microsoft 16 years to implement a form of multi-line strings? (Working from the original May 1991 release date for VB 1.0, Comdex/Windows World trade show in Atlanta, Georgia) The original bourne shell released with Unix Version 7 (in 1977) had here-documents.&lt;/p&gt;
</description></item><item><title>re: Embed Code and Avoid Underscores in Your Multiline Strings </title><link>http://blogs.msdn.com/bethmassi/archive/2007/10/23/avoid-underscores-in-your-multiline-strings.aspx#9436495</link><pubDate>Fri, 20 Feb 2009 23:02:55 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9436495</guid><dc:creator>vbuser</dc:creator><description>&lt;p&gt;should be able to&lt;/p&gt;
&lt;p&gt;dim s as string&lt;/p&gt;
&lt;p&gt;s = |&lt;/p&gt;
&lt;p&gt;This is&lt;/p&gt;
&lt;p&gt;a &lt;/p&gt;
&lt;p&gt;multiline&lt;/p&gt;
&lt;p&gt;string|&lt;/p&gt;
&lt;p&gt;VB and LotusScript supported this simple method. &amp;nbsp;Using the suggested xml text is buggy. &amp;nbsp;You will get errors in Studio 08 depending on what is in &amp;nbsp;the text (and its all text with no &amp;lt;&amp;gt; substitutions). &amp;nbsp;I can't use the suggestion above because it only sometimes works and isn't predictable.&lt;/p&gt;</description></item><item><title>re: Embed Code and Avoid Underscores in Your Multiline Strings </title><link>http://blogs.msdn.com/bethmassi/archive/2007/10/23/avoid-underscores-in-your-multiline-strings.aspx#9449569</link><pubDate>Fri, 27 Feb 2009 23:22:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9449569</guid><dc:creator>Beth Massi</dc:creator><description>&lt;p&gt;Hi vbuser,&lt;/p&gt;
&lt;p&gt;Can you show me an example of text that won't work? &lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;-B&lt;/p&gt;
</description></item><item><title>re: Embed Code and Avoid Underscores in Your Multiline Strings </title><link>http://blogs.msdn.com/bethmassi/archive/2007/10/23/avoid-underscores-in-your-multiline-strings.aspx#9508412</link><pubDate>Wed, 25 Mar 2009 23:38:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9508412</guid><dc:creator>Dan Neuman</dc:creator><description>&lt;p&gt;Beth,&lt;/p&gt;
&lt;p&gt;I really like this. &amp;nbsp;I used the Text/EndText in VFP to write my SQL strings and it would be easy to copy commands between VFP and Query Analyzer.&lt;/p&gt;
&lt;p&gt;Using your new construct, I am having problems with the following code where the visual studio compiler is giving me errors. &amp;nbsp;It appears to not like my &amp;quot;less than&amp;quot; sign in the middle of the string... any ideas?&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Dim sProblem = &amp;lt;myxml&amp;gt;select * from detailinfo where isnull(FaxedDate, '1900-1-1') &amp;lt; '1901-1-1'&amp;lt;/myxml&amp;gt;&lt;/p&gt;</description></item><item><title>re: Embed Code and Avoid Underscores in Your Multiline Strings </title><link>http://blogs.msdn.com/bethmassi/archive/2007/10/23/avoid-underscores-in-your-multiline-strings.aspx#9508468</link><pubDate>Wed, 25 Mar 2009 23:58:52 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9508468</guid><dc:creator>Beth Massi</dc:creator><description>&lt;p&gt;Hi Dan,&lt;/p&gt;
&lt;p&gt;Remember that this is XML. All XML parsing rules apply so you cannot place &amp;lt; or &amp;gt; characters in the element. Here is a list of XML Entities that are reserved: &lt;a rel="nofollow" target="_new" href="http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Predefined_entities_in_XML"&gt;http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Predefined_entities_in_XML&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;However you can still render them by using the entity's name instead. In your example it would be:&lt;/p&gt;
&lt;p&gt; Dim sProblem = &amp;lt;myxml&amp;gt;select * from detailinfo where isnull(FaxedDate, '1900-1-1') &amp;amp;lt; '1901-1-1'&amp;lt;/myxml&amp;gt;&lt;/p&gt;
&lt;p&gt;MsgBox(sProblem.Value)&lt;/p&gt;
&lt;p&gt;HTH,&lt;/p&gt;
&lt;p&gt;-B&lt;/p&gt;
</description></item><item><title>re: Embed Code and Avoid Underscores in Your Multiline Strings </title><link>http://blogs.msdn.com/bethmassi/archive/2007/10/23/avoid-underscores-in-your-multiline-strings.aspx#9511631</link><pubDate>Thu, 26 Mar 2009 21:52:39 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9511631</guid><dc:creator>Dan Neuman</dc:creator><description>&lt;p&gt;Beth,&lt;/p&gt;
&lt;p&gt;Thank you for the quick response. &amp;nbsp;Just couple more questions, my &amp;quot;coding police&amp;quot; wont let me use variants in my declarations. &amp;nbsp;What is the datatype that is used for this? &amp;nbsp;Also, as I try this in a few of my projects, I get very long error messages about system.xml is not available, eventhough it is listed at the top of the module.&lt;/p&gt;
&lt;p&gt;dim sProblem as ???&lt;/p&gt;</description></item><item><title>re: Embed Code and Avoid Underscores in Your Multiline Strings </title><link>http://blogs.msdn.com/bethmassi/archive/2007/10/23/avoid-underscores-in-your-multiline-strings.aspx#9511726</link><pubDate>Thu, 26 Mar 2009 22:28:15 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9511726</guid><dc:creator>Beth Massi</dc:creator><description>&lt;p&gt;Hi Dan,&lt;/p&gt;
&lt;p&gt;You're using Visual Studio 2008 and Visual Basic 9 so the compiler will automatically infer the type of the variable. This is specified by Option Infer ON (which is the default in new projects). You should have Option Strict, Explicit and Infer all ON. Your statement above is not an Object (no variants in .NET ;-)) it is inferred by the compiler and still is strongly typed. Just hover over the variable and you should see the type of it. In this case it is an XElement. But you can be explict and say Dim sProblem as XElement = ... if that appeases the gods. It's just more typing ;-)&lt;/p&gt;
&lt;p&gt;HTH,&lt;/p&gt;
&lt;p&gt;-B&lt;/p&gt;
</description></item><item><title>re: Embed Code and Avoid Underscores in Your Multiline Strings </title><link>http://blogs.msdn.com/bethmassi/archive/2007/10/23/avoid-underscores-in-your-multiline-strings.aspx#9511875</link><pubDate>Thu, 26 Mar 2009 23:32:51 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9511875</guid><dc:creator>Dan Neuman</dc:creator><description>&lt;p&gt;ok, last question I hope. &amp;nbsp;As I try this on a project that was upgraded from VS2005 to VS2008, I get an error message that reads &amp;quot;XML literals and XML axis properties are not available. &amp;nbsp;Add references to System.xml, System.xml.linq, and system.core.&lt;/p&gt;
&lt;p&gt;System.xml is already part of the project, and it won't allow me to add system.xml.linq. &amp;nbsp;any ideas what I am missing?&lt;/p&gt;</description></item><item><title>re: Embed Code and Avoid Underscores in Your Multiline Strings </title><link>http://blogs.msdn.com/bethmassi/archive/2007/10/23/avoid-underscores-in-your-multiline-strings.aspx#9511915</link><pubDate>Thu, 26 Mar 2009 23:43:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9511915</guid><dc:creator>Beth Massi</dc:creator><description>&lt;p&gt;Hi Dan,&lt;/p&gt;
&lt;p&gt;You'll need to set the framework target to 3.5 first.&lt;/p&gt;
&lt;p&gt;See:&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://msdn.microsoft.com/en-us/library/07bysfz2.aspx"&gt;http://msdn.microsoft.com/en-us/library/07bysfz2.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;and &lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://msdn.microsoft.com/en-us/library/bb398197.aspx"&gt;http://msdn.microsoft.com/en-us/library/bb398197.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;HTH,&lt;/p&gt;
&lt;p&gt;-B&lt;/p&gt;
</description></item><item><title>re: Embed Code and Avoid Underscores in Your Multiline Strings </title><link>http://blogs.msdn.com/bethmassi/archive/2007/10/23/avoid-underscores-in-your-multiline-strings.aspx#9833396</link><pubDate>Tue, 14 Jul 2009 21:49:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9833396</guid><dc:creator>Dan Neuman</dc:creator><description>&lt;p&gt;Beth,&lt;/p&gt;
&lt;p&gt;Someone just asked me to do this in C#. &amp;nbsp;I love the ability to have the XML evalualated in the middle of the string with the &amp;lt;%=variable name%&amp;gt;. &amp;nbsp;Do you know how I would do the same thing in C#?&lt;/p&gt;
&lt;p&gt;I tried translating the statements, but I got stuck. &amp;nbsp;If you could translate your &amp;quot;simple&amp;quot; example above, I can take it from there.&lt;/p&gt;
&lt;p&gt;Thanks for everything.&lt;/p&gt;
&lt;p&gt;Dan&lt;/p&gt;</description></item><item><title>re: Embed Code and Avoid Underscores in Your Multiline Strings </title><link>http://blogs.msdn.com/bethmassi/archive/2007/10/23/avoid-underscores-in-your-multiline-strings.aspx#9833404</link><pubDate>Tue, 14 Jul 2009 21:59:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9833404</guid><dc:creator>Beth Massi</dc:creator><description>&lt;p&gt;Hi Dan,&lt;/p&gt;
&lt;p&gt;C# doesn't support XML literals syntax. You'll need to call the LINQ to XML API directly.&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://msdn.microsoft.com/en-us/library/bb387061.aspx"&gt;http://msdn.microsoft.com/en-us/library/bb387061.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;HTH,&lt;/p&gt;
&lt;p&gt;-B&lt;/p&gt;
</description></item></channel></rss>