HOW TO: Optimally concatenate in a method

Find out how to get things done with Servoy. Post how YOU get things done with Servoy

HOW TO: Optimally concatenate in a method

Postby Jan Aleman » Tue Aug 17, 2004 8:50 pm

Many times if you'r moving a large string into a dataprovider you'll want to spread it over multiple lines to increase readibility of your methods:

Code: Select all
globals.myHtmlField = "<html><head>header stuff here</head>"
globals.myHtmlField += "<body> body here </body>"
globals.myHtmlField += "etc etc"


Both if you're doing this to a global that is used on a screen or to a column of a table it will be much more cpu intensive then first constructing the entire contents in a variable and then putting it into the dataprovider:

Code: Select all
var myHtml  = "<html><head>header stuff here</head>"
myHtml += "<body> body here </body>"
myHtml += "etc etc"
globals.myHtml = myHtml
Jan Aleman
Servoy
Jan Aleman
 
Posts: 2083
Joined: Wed Apr 23, 2003 9:49 pm
Location: Planet Earth

Return to How To

Who is online

Users browsing this forum: No registered users and 5 guests