Admin1676454018 Posted August 22, 2008 Share Posted August 22, 2008 This function is useful for concatenating fields together when copyfitting single lines using the Copyfitline() function. In order to do that often times you need to concatenate fields together using a rule to be able to pass it to the function. It's used mostly for FirstName, MiddleName and LastName type of fields, but could be anything you need to put together such as City, State, zip. It puts spaces between the fields and checks for an empty field, such as a middleName field that may not have any data and skips that field if empty. You can pass it any number of fields. Put the following in Globals. ConcatStr = function () { var strReturn = new String(''); for (i=0; i<arguments.length; i++) { if (!arguments == ""){ strReturn += arguments; if (i<arguments.length){ strReturn += " "; } } } return(strReturn); } //Call it like this: //return ConcatStr(Field("firstName"), Field("MiddleName"), Field("LastName")); //With many thanks to Brad Rice Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.