Topic
  • 2 replies
  • Latest Post - ‏2013-07-11T12:25:34Z by JDD23
JDD23
JDD23
8 Posts

Pinned topic hard Return (WordWrap) Problem

‏2013-07-10T12:03:46Z |

Need your help:  I'm trying to combine the contents of two fields ((1) Risk_Condition, (2) Risk_Consequence) into a third field (Risk_Statement).  All fields are multi-line.

The script below works but the contents of the second field are placed on a new line--I need it to continue on the same line. 

I'm thinking that my problem is in the way I have combined the the two fields (using +)?  How do I fix?

Dim Condition
Dim Consequence
Dim RiskStatement

 Condition = GetFieldValue ("Risk_Condition").GetValue()
 Consequence = GetFieldValue ("Risk_Consequence").GetValue()
 RiskStatement = Condition + "; " + Consequence
 SetFieldValue "Risk_Statement", RiskStatement

Thanks in advance. JDD223

  • DonaldN
    DonaldN
    287 Posts

    Re: hard Return (WordWrap) Problem

    ‏2013-07-11T00:09:00Z  

    You need to make sure that there are no carriage return or line feed characters at the end of the first string "Condition" or the beginning of the second string "Consequence" before joining them together.

    If you Google "vbscript trim carriage return", you will find a lot of answers. Here are two for your reference.

    http://blogs.technet.com/b/heyscriptingguy/archive/2005/05/20/how-can-i-remove-the-last-carriage-return-linefeed-in-a-text-file.aspx

    http://computer-programming-forum.com/59-vbscript/ef72aaccc0d98b5f.htm

  • JDD23
    JDD23
    8 Posts

    Re: hard Return (WordWrap) Problem

    ‏2013-07-11T12:25:34Z  
    • DonaldN
    • ‏2013-07-11T00:09:00Z

    You need to make sure that there are no carriage return or line feed characters at the end of the first string "Condition" or the beginning of the second string "Consequence" before joining them together.

    If you Google "vbscript trim carriage return", you will find a lot of answers. Here are two for your reference.

    http://blogs.technet.com/b/heyscriptingguy/archive/2005/05/20/how-can-i-remove-the-last-carriage-return-linefeed-in-a-text-file.aspx

    http://computer-programming-forum.com/59-vbscript/ef72aaccc0d98b5f.htm

    Thanks DonaldN, that did the trick.