Hi all,

I frequently need to paste something copied from elsewhere into the IDE
as a string literal (most often, when building unit tests).  This means
slapping quotes around it and doubling any internal quotes, which is a
nuisance.  So first I filed this feature request:

  http://www.realsoftware.com/feedback/viewreport.php?reportid=nykpjruo

But then I realized that in the meantime, I could add a script to the
IDE Scripts menu that does this too.  Here's the script:

  // Pastes the clipboard content while converting to a string literal.
  Dim s As String = Clipboard
  s = ReplaceAll( s, """", """""" )
  SelText = """" + s + """"

Save this in your IDE Scripts folder as "Paste as String Literal", and
now at least you have a way to do it.  I'd still prefer to access it
from the Edit menu under Paste Special, but until then, maybe you'll
find this useful.

(And yes, this could be a one-liner, but I prefer the clarity of
multiple steps in this case.)

Best,
- Joe

P.S. Anybody have any other generally useful IDE scripts to share?



--
Joe Strout -- [EMAIL PROTECTED]
Verified Express, LLC     "Making the Internet a Better Place"
http://www.verex.com/

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to