April 24, 2010

The concat function - XpressDox

The concat function joins together, or concatenates, 2 or more strings

 

The strings that you join together can consist of data elements and/or hard-coded strings, or even XpressDox functions. Let’s start with a simple example demonstrating how to join together 2 data elements separated by a space, as shown in the example below. Remember that you can use the Command Assistant for guidance on how to construct the command.

«Comment(Suppose you have 2 data elements called First_name and Last_name and you need to make them into one)»
«concat(First_name,’ ‘,Last_name)»

Notice that there are in fact 3 elements joined together; 2 data elements and a space, each separated by a comma. The space is enclosed in quotes because it is hard-coded text.

 

 

Now combine the concat function with other commands / functions. For example:

 

Inside a Set command:

«Name» «Surname»
«FullName»
«Set(FullName,(),concat(Name,’ ‘,Surname))»
«ReadOnly(FullName)»

 

Use with a script:

Look at this article to see the concat function used inside a parameterized script.

 

 

Inside a FileExists which is itself a condition inside IncludeFileData

«IncludeFileData(.\Datasets\.xddata.xml,Refresh,,,FileExists(concat(‘.\Datasets\’,MatterID,’.xddata.xml’)))»