Scripting question, Formatting Text

Line Breaks

Wednesday, February 7, 2007 by gb79 | Discussion: DesktopX

I'm working on a macro that pulls in text from an XML document. I am trying to combine several elements of the XML file into one string with line breaks. Combining them into one string works great, however I cannot get the line breaks to work. Here is what I have tried:

Object.Text = "Writer: " & DesktopX.ScriptObject("Comic_Window").Writer1 & "/nArtist: " & DesktopX.ScriptObject("Comic_Window").Artist1

and

Object.Text = "Writer: " & DesktopX.ScriptObject("Comic_Window").Writer1 & "<br />Artist: " & DesktopX.ScriptObject("Comic_Window").Artist1


Both examples type out the line break code in the text box. I believe it is not evaluating this string for any html script. Is there something I can do to break this string into multiple lines?

Thanks,
Greg
sViz
Reply #1 Wednesday, February 7, 2007 9:35 AM
Have you tried vbcrlf? Like this:

Object.Text = "Writer: " & DesktopX.ScriptObject("Comic_Window").Writer1 & vbcrlf & "Artist: " & DesktopX.ScriptObject("Comic_Window").Artist1

gb79
Reply #2 Wednesday, February 7, 2007 9:57 AM
Thank you so much sViz, that worked perfectly.

I had read so many tutorials and tried searching online for that solution, but not once has vbcrlf come up. This makes me wonder, how many other script hints am I missing out on.

If you know of any resource I could use to help me figure out this scripting, I'd appreciate it.

My next challenge is importing images using the url path I've pulled from the XML, and I'm at a loss on how to pull that off.

Thanks again,
Greg
sViz
Reply #3 Wednesday, February 7, 2007 10:11 AM
Your welcome.

The number 1 recommendation would be w3schools.com

They've got a whole section on Vbscript - HERE

And of course there's always here on the WC forums.

thomassen
Reply #4 Wednesday, February 7, 2007 2:10 PM
/n is a string feature in Javascript. In VBS you have to use vbcrlf.
Skarny
Reply #5 Sunday, February 25, 2007 5:17 AM
vbcrlf...
dagnammit, I've been messing with CHR(13) and (11) (or whatever) combinations forever.....
cheers

Please login to comment and/or vote for this skin.

Welcome Guest! Please take the time to register with us.
There are many great features available to you once you register, including:

  • Richer content, access to many features that are disabled for guests like commenting on the forums and downloading skins.
  • Access to a great community, with a massive database of many, many areas of interest.
  • Access to contests & subscription offers like exclusive emails.
  • It's simple, and FREE!



web-wc01