# Input Formula Functions

You can specify string and arithmetic functions to be used to configure the values returned by the input formula.

Access the functions by clicking next to Input Formula.

## Arithmetic Functions

 Function Add Numbers Description Returns the sum of the two specified numbers. Syntax Add(,) Arguments - First term - Second term Example Add(2,3)Returns 5
 Function Subtract Numbers Description Returns the difference between the two specified numbers. Syntax Sub(,) Arguments - First term - Second term (amount to be subtracted) Example Sub(3,2)Returns 1
 Function Multiply Numbers Description Returns the result of multiplying the two specified numbers. Syntax Multiply(,) Arguments - First term - Second term (amount to multiply by) Example Multiply(3,2)Returns 6
 Function Divide Numbers Description Returns the result of dividing a number by a second number. Syntax Divide(,) Arguments - First term - Second term (amount to divide by) Example Divide(6,2)Returns 3

## String Functions

 Function Left Substring Description Returns the leftmost specified number of characters from a specified string. Syntax Left(,) Arguments - The character string - The number of characters to be returned Example Left(ProjectAA,7)Returns "Project"
 Function Right Substring Description Returns the rightmost specified number of characters from a specified string. Syntax Right(,) Arguments - The character string - The number of characters to be returned Example Right(ProjectAA,2)Returns "AA"
 Function Middle Substring Description Returns a substring from a specified string (starting at a specified position). Syntax Mid(,,) Arguments - The character string - The number of the starting position. The first character is position 0. - The number of characters to be returned Example Mid(ProjectAA,2,2)Returns "oj"
Function String X from List
Description Returns the element number X from an ordered list where the elements are delimited with a certain character.

This feature is useful in combination with controls connected to alias lists.

Syntax

\$Token(<string>|<string>|<string>|<string>,<index>,|)

Arguments

<string> - List of strings to choose from.

<index> - Index of string to use. This could be a variable linked to an alias list.

| - The character used to separate the <string> values.

Example

\$Token(Metal|Plastic|Metal|Organic|Plastic,,|

Where the Material variable is connected to an alias list with the following values:
Displayed Value Alias
Steel 1
Polyester 2
Gold 3
Wood 4
PVC 5
The formula string becomes Metal if the user selects Steel or Gold as the material. It becomes Plastic if the user selects Polyester or PVC.
 Function String Length Description Returns the length of a specified string. Syntax Length() Arguments - The character string Example Length(ProjectAA)Returns 9
 Function Find Substring Description Searches a specified string for the first match of a character or substring. Returns the position where the character or substring is found.The first position in the character string is 0. Syntax Find(,) Arguments - The character string - The character substring for which to search Example Find(abc,b)Returns 1
 Function Reversed Find Substring Description Returns the reverse of a specified string. Syntax Reverse() Arguments - The character string Example Reverse(stockholm)Returns "mlohkcots"
 Function Reverse Find Description Searches a specified string for the last match of a character. Returns the position where the last occurrence of the character or substring is found. The first position in the character string is 0. Syntax Find(,) Arguments - The character string - The character substring for which to search Example ReverseFind(abcabc,b) Returns 4
 Function Today's Date Description Returns the current date in the format selected when the vault was created. Syntax \$Time() Arguments Examples =\$Time() Returns 488a=2010-08-13

Provide feedback on this topic

* Required

 *Email: Subject: Feedback on Help Topics Page: Input Formula Functions *Comment: * I acknowledge I have read and I hereby accept the privacy policy under which my Personal Data will be used by Dassault Systèmes

Print Topic

Select the scope of content to print:

x

We have detected you are using a browser version older than Internet Explorer 7. For optimized display, we suggest upgrading your browser to Internet Explorer 7 or newer.

Never show this message again
x

Web Help Content Version: SOLIDWORKS PDM 2012 SP05

To disable Web help from within SOLIDWORKS and use local help instead, click Help > Use SOLIDWORKS Web Help.

To report problems encountered with the Web help interface and search, contact your local support representative. To provide feedback on individual help topics, use the “Feedback on this topic” link on the individual topic page.