Results 1 to 3 of 3

Thread: VB6 - QuoteMe: Format Text as VB Code

  1. #1

    Thread Starter
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Lightbulb VB6 - QuoteMe: Format Text as VB Code

    Sometimes it can be tricky typing the exact string you want as VB source code. Quite often the issue is quote (") characters within the string, which need to be escaped. Other times the issue gets even more confusing when you need to wrap long lines with continuations.

    So here we have QuoteMe, a small utility meant to help automate this.

    The basic idea is that you know exactly what you need to put into the string. So you type or paste this into one textbox, then click a button and magically have it converted to VB source in a second textbox.

    QuoteMe can do that.

    But what if you really need to replace some of your literals in this string by variables or expressions?

    Well QuoteMe can help there too.

    You can mark these parts of your original text in QuoteMe just by selecting the text via mouse or keyboard. Just mark the parts of the text that you want to have as variables or expressions, then click the Format as Code button.

    The results are copied to the clipboard for you, just paste it into your IDE or editor and replace the Varn variables by your own variables or string expressions.


    Honestly, there may still be some bugs in the code that might result in bad code being generated. This is why I have posted to the CodeBank instead of the UtilityBank: I'm not sure it is ready.

    But you can help by reporting bugs... with fixes if you have them! Parts of the code are a bit nasty and this is one of those parts. If you have a way to simplify and improve it that would be great to hear about too!

    The compiled EXE is useful for those writing VBA and VBScript as well. But until I get ready for a move to the UtilityBank I won't be providing a compiled version.
    Attached Images Attached Images  
    Attached Files Attached Files

  2. #2
    Fanatic Member
    Join Date
    Mar 2009
    Posts
    804

    Re: VB6 - QuoteMe: Format Text as VB Code

    A fine utility. I have some VB code for generating HTML pages and this will
    be helpful for that. For example: <LINK REL="STYLESHEET" HREF="style.css">

    This would, I think, be a good candidate for an addin.

  3. #3

    Thread Starter
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Re: VB6 - QuoteMe: Format Text as VB Code

    Building it as an add-in was my original thought, and I might consider that once I'm more sure there aren't too many nasty bugs left in it.

    This would still be useful for Office VBA folks, but it might leave VBScripters standing hat-in-hand unless they use the Office Script Editor.

    Good feedback though, thanks!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width