Source language: Translate to:

VbScript: Carriage Return or LineFeed in String Parameter

Questions and information about using VBScript and JavaScript in NeoBook functions

Moderator: Neosoft Support

VbScript: Carriage Return or LineFeed in String Parameter

Postby Apoleo » Fri Jan 21, 2011 7:01 am

Hi, I had the next problem.

When I call a VBScript function and I want to pass a string parameter like these:
Code: Select all
publication.nbSetVar "[%2]" , MyFunction("[%1]")

There may be problems if the string contains CarriageReturn or LineFeed chars.

So before to send the string to the Call action, we have to do this:

Code: Select all
StrReplace "[x]" "[#13][#10]" "[#34]&vbCrLf&[#34]" "[x]" ""
StrReplace "[x]" "[#13]" "[#34]&vbCr&[#34]" "[x]" ""
StrReplace "[x]" "[#10]" "[#34]&vbLf&[#34]" "[x]" ""
Call "VbScriptFunction" "[x]" "Return"

I hope it's useful to someone
User avatar
Posts: 88
Joined: Sat May 14, 2005 1:17 pm
Location: Sevilla, España

Postby Alex » Fri Jan 21, 2011 9:51 am


Thank you, very useful.


Posts: 745
Joined: Sat Mar 04, 2006 4:53 am

Return to NeoBook Functions - VBScript & JavaScript

Who is online

Users browsing this forum: No registered users and 0 guests