<?xml version="1.0" encoding="utf-8"?>
<ManualTopic ID="/baanerp/ti/onlinemanual/100002" xml:lang="en">
	<Header>
		<Title xmlns:ssa="http://www.ssaglobal.com" xmlns:HTML="http://www.w3.org/TR/REC-html40">Constraint editor</Title>
	</Header>
	<GeneralSection><GeneralSection><SectionTitle>Syntax of constraint expressions</SectionTitle>
			<Paragraph>The constraint expressions syntax is a subset of the SSA ERP Tools syntax. You can make constraint expressions with the following basic instructions.</Paragraph>
			<List><ListIntro>Arithmetic operators:</ListIntro>
				<ListItem>* (multiplication)</ListItem>
				<ListItem>/ (division)</ListItem>
				<ListItem>+ (addition)</ListItem>
				<ListItem>- (subtraction)</ListItem>
				<ListItem>/ (remainder after division)</ListItem>
				<ListItem>&amp; (linking alphanumeric arrays)</ListItem>
			</List>
			<List><ListIntro>Logical operators:</ListIntro>
				<ListItem>or</ListItem>
				<ListItem>and</ListItem>
				<ListItem>not</ListItem>
			</List>
			<List><ListIntro>Relational operators:</ListIntro>
				<ListItem>= (equal to)</ListItem>
				<ListItem>&gt; (greater than)</ListItem>
				<ListItem>&gt;= (greater than or equal to)</ListItem>
				<ListItem>&lt;&gt; (not equal to)</ListItem>
				<ListItem>&lt; (less than)</ListItem>
				<ListItem>&lt;= (less than or equal to)</ListItem>
			</List>
		</GeneralSection>
		<GeneralSection><SectionTitle>Domain expresssions</SectionTitle>
			<Paragraph>A is {a1,a2,a3-a4,..} means: (A=a1 or A=a2 or A &gt;= a3 and A &lt;= a4 and so on).</Paragraph>
			<Paragraph>The domain expression syntax is an abbreviated notation for logical expressions regarding the domain of a variable.</Paragraph>
		</GeneralSection>
		<GeneralSection><SectionTitle>Priority in expressions</SectionTitle>
			<Paragraph>Arithmetic operators have a higher priority than relational operations.</Paragraph>
			<Paragraph>Relational operations have a higher priority than logical operators.</Paragraph>
			<Paragraph>The priority sequence for arithmetic operators : * / \ + -</Paragraph>
			<Paragraph>The priority sequence for logical operators : not, and, or</Paragraph>
			<Paragraph>Round brackets ('()') can be used to change the priority sequence for arithmetic and logical operators.</Paragraph>
			<ExampleSection><SectionTitle>Example</SectionTitle>
				<Paragraph>3 + 4 * 5 = 23</Paragraph>
				<Paragraph>(3 + 4) * 5 = 35</Paragraph>
			</ExampleSection>
		</GeneralSection>
		<GeneralSection><SectionTitle>Boolean expressions</SectionTitle>
			<Paragraph>Boolean expressions can have the value true or false (1 or 0). This can be applied in constraints, especially conditional expressions.</Paragraph>
		</GeneralSection>
		<ExampleSection><SectionTitle>Example</SectionTitle>
			<Paragraph>If not e then ' means:</Paragraph>
			<Paragraph>If e = false then'</Paragraph>
			<Paragraph>or If e = 0 then'</Paragraph>
		</ExampleSection>
		<GeneralSection><SectionTitle>If-then-else constructions</SectionTitle>
			<Paragraph>Extensive if-then-else constructions can be used in constraints. Nesting of statements is allowed.</Paragraph>
			<ExampleSection><SectionTitle>Example</SectionTitle>
				<Paragraph>If expression1</Paragraph>
				<Paragraph>then expression2</Paragraph>
				<Paragraph>else expression3</Paragraph>
				<Paragraph>endif</Paragraph>
			</ExampleSection>
			<Paragraph>An if-then-else construction is always closed with an endif statement. The else statement is not mandatory. If, else and endif statements always start on a new line. (Conditional) expressions can be divided over several lines. A validation constraint may be defined without if-then-else statements; this constraint must start with c:.</Paragraph>
			<Paragraph>A constraint can be provided with comments using the | sign. During the configuration process, you can generate messages using the variable message (up to 80x25 lines of text).</Paragraph>
		</GeneralSection>
		<GeneralSection><SectionTitle>Constraint variables</SectionTitle>
			<Paragraph>Both global and local variables can be used in constraint expressions. Global variables are product features and user-defined constraint variables that are declared as global. The variables predefined by the product configurator, such as input, display, length, width, and so on, are local ones. Global variables retain their value throughout the configuration process unless their values are changed.</Paragraph>
			<List><ListIntro>A constraint variable can have the following type declarations:</ListIntro>
				<ListItem>string (alphanumeric) (for example: string machine global)</ListItem>
				<ListItem>long (integers) (for example: long i)</ListItem>
				<ListItem>double (fractions) (for example: double j)</ListItem>
			</List>
			<Paragraph>The user-defined constraint variables must always be declared at the top of the constraint. All local variables are initialized before execution of the constraint: alphanumeric variables are cleared and numeric variables are given the value zero. The global variables input and validating are initialized with the value true.</Paragraph>
		</GeneralSection>
		<GeneralSection><SectionTitle>Use of constraint variables</SectionTitle>
			<Paragraph>Product features must be provided with opening and closing square brackets ([......])in constraint expressions. The remaining variables can directly be used in expressions. Alphanumeric variables (string arrays) can be indexed according to the notation: (startposition[;length]).</Paragraph>
		</GeneralSection>
		<ExampleSection><SectionTitle>Example</SectionTitle>
			<Paragraph>[color] = "red"</Paragraph>
			<Paragraph>validating = true</Paragraph>
			<Paragraph>The values of variables can be alphanumeric or numeric. Alphanumeric values must be written in quotation marks ("...."). Numeric values can directly be entered. The decimal sign is a point ('.').</Paragraph>
		</ExampleSection>
		<ExampleSection><SectionTitle>Example</SectionTitle>
			<Paragraph>machine(1;2) = "A5"</Paragraph>
			<Paragraph>volume = 28.673</Paragraph>
			<Paragraph>The constants true/false can be used for boolean expressions.</Paragraph>
		</ExampleSection>
		<GeneralSection><SectionTitle>Arithmetic functions</SectionTitle>
			<List><ListItem>round(X,Y,Z): produces rounded value of X; Y is number of decimals and Z is rounding method (0 = down, 1 = normal, 2 = up)</ListItem>
				<ListItem>val(A) : produces numeric value of string A (val("8.7") = 8.7)</ListItem>
				<ListItem>abs(X) : calculates absolute value of X (abs(-10.3) = 10.3)</ListItem>
				<ListItem>int(X) : produces integer value of X (int(11.6) = 11)</ListItem>
				<ListItem>pow(X,Y) : raises X to the power of Y (pow(10,2) = 100)</ListItem>
				<ListItem>sqrt(X) : produces square root of X (sqrt(16) = 4)</ListItem>
				<ListItem>min(X,Y) : produces smallest value of X and Y (min(6,10) = 6)</ListItem>
				<ListItem>max(X,Y) : produces largest value of X and Y (max(6,10) = 10)</ListItem>
				<ListItem>pi : constant with value PI (3.1415926...)</ListItem>
			</List>
		</GeneralSection>
		<GeneralSection><SectionTitle>Goniometric functions</SectionTitle>
			<List><ListItem>sin(X), cos(X), tan(X) : produces sine, cosine, or tangent of X (radials)</ListItem>
				<ListItem>asin(X), acos(X), atan(X): produces arc sine, cosine, or tangent of X</ListItem>
				<ListItem>hsin(X), hcos(X), htan(X): produces hyperbolic sine, cosine, or tangent of X</ListItem>
			</List>
		</GeneralSection>
		<GeneralSection><SectionTitle>Logarithmic functions</SectionTitle>
			<List><ListItem>exp(X) : raises e to the power of X</ListItem>
				<ListItem>log(X) : produces natural logarithm of X on the basis of e</ListItem>
				<ListItem>log10(X): produces logarithmic value of X on the basis of powers of 10</ListItem>
			</List>
		</GeneralSection>
		<GeneralSection><SectionTitle>String functions</SectionTitle>
			<List><ListItem>edit(X,Y) : formats numeric value X according to format Y (edit(10.3,"ZZZ9V.99") = " 10.30"</ListItem>
				<ListItem>str(X) : puts numeric value in string (str(10.3) = "10.3")</ListItem>
				<ListItem>len(X) : produces length of string X (len("abc") = 3)</ListItem>
				<ListItem>strip(X) : deletes spaces after last character (strip("A ") "A")</ListItem>
				<ListItem>pos(X,Y) : produces position of string Y in string X from left</ListItem>
				<ListItem>rpos(X,Y) : produces position of string Y in string X from right</ListItem>
			</List>
		</GeneralSection>
		<GeneralSection><SectionTitle>Date functions</SectionTitle>
			<List><ListItem>date() : produces the number of days between day 0 and current date</ListItem>
				<ListItem>date(y,m,d): produces the number of days between day 0 and entered date</ListItem>
			</List>
		</GeneralSection>
		<ExampleSection><SectionTitle>Example</SectionTitle>
			<Paragraph>date(1995,06,01) = 728445</Paragraph>
		</ExampleSection>
	</GeneralSection>
</ManualTopic>
