<?xml version="1.0" encoding="utf-8"?>
<ManualTopic ID="/baanerp/qm/onlinemanual/000004" xml:lang="en">
	<Header>
		<Title xmlns:ssa="http://www.ssaglobal.com" xmlns:HTML="http://www.w3.org/TR/REC-html40">Syntax for expressions</Title>
		<Keyword><Level1>Syntax for expressions in quality management (QM)</Level1>
		</Keyword>
	</Header>
	<GeneralSection><List><ListIntro>The following subjects are mentioned below with regard to the syntax for expressions:</ListIntro>
			<ListItem>Variables, for example, Voltage</ListItem>
			<ListItem>Operators, for example, Multiplication</ListItem>
			<ListItem>Functions, for example, Rounding</ListItem>
			<ListItem>Examples</ListItem>
		</List>
		<GeneralSection><SectionTitle>VARIABLES</SectionTitle>
			<Paragraph></Paragraph>
			<Paragraph>Variables are defined in the <Link href="/baanerp/qm/ptc/qmptc0123m000" role="session">Algorithm Variables (qmptc0123m000)</Link> session and can be linked to characteristics in the <Link href="/baanerp/qm/ptc/qmptc0122m000" role="session">Algorithm - Variables (qmptc0122m000)</Link> session.</Paragraph>
			<Paragraph>Variables are case sensitive and must be entered in uppercase to be regarded as proper variables.</Paragraph>
		</GeneralSection>
		<ExampleSection><SectionTitle>Example</SectionTitle>
			<TABLE border="1"><TBODY><TR><TD>Correct</TD>
						<TD>1D, TA, V1, and so on</TD>
					</TR>
					<TR><TD>Incorrect</TD>
						<TD>1d, Ta, ta, v1, and so on</TD>
					</TR>
				</TBODY>
			</TABLE>
		</ExampleSection>
		<GeneralSection><SectionTitle>OPERATORS</SectionTitle>
			<GeneralSection><SectionTitle>Arithmetic operators:</SectionTitle>
				<TABLE border="1"><TBODY><TR><TD>* / + -</TD>
							<TD>multiplication/division/addition/subtraction</TD>
						</TR>
						<TR><TD>\</TD>
							<TD>remainder after division</TD>
						</TR>
						<TR><TD>&amp;</TD>
							<TD>linking strings (alphanumeric arrays)</TD>
						</TR>
					</TBODY>
				</TABLE>
			</GeneralSection>
			<GeneralSection><SectionTitle>Logical operators</SectionTitle>
				<Paragraph>or, and, not</Paragraph>
				<Paragraph>Logical operators are used in Boolean expressions. These expressions are either true or not true. The logical value true corresponds to value 1 and the logical value not true corresponds to 0.</Paragraph>
			</GeneralSection>
			<GeneralSection><SectionTitle>Relational Operators:</SectionTitle>
				<TABLE border="1"><TBODY><TR><TD>=</TD>
							<TD>equal to</TD>
						</TR>
						<TR><TD>&lt;&gt;</TD>
							<TD>not equal to</TD>
						</TR>
						<TR><TD>&gt;</TD>
							<TD>greater than</TD>
						</TR>
						<TR><TD>&gt;=</TD>
							<TD>greater than or equal to</TD>
						</TR>
						<TR><TD>&lt;</TD>
							<TD>less than</TD>
						</TR>
						<TR><TD>&lt;=</TD>
							<TD>less than or equal to</TD>
						</TR>
					</TBODY>
				</TABLE>
				<Paragraph>Assignment commands are recorded by means of :=</Paragraph>
			</GeneralSection>
			<GeneralSection><SectionTitle>Priority in expressions:</SectionTitle>
				<Paragraph></Paragraph>
				<List><ListItem>Arithmetic operators have priority over relational operators</ListItem>
					<ListItem>Relational operators have priority over logical operators</ListItem>
					<ListItem>The priority sequence for arithmetic operators is: * / \ + -</ListItem>
					<ListItem>The priority sequence for logical operators is: not, and, or</ListItem>
				</List>
			</GeneralSection>
			<Note><SectionTitle>Note</SectionTitle>
				<Paragraph>These sequences can be modified by means of round brackets.</Paragraph>
			</Note>
			<ExampleSection><SectionTitle>Example</SectionTitle>
				<Formula><Paragraph UserLevel="Novice" UserType="Taskuser"> 3 + 4 * 5 = 23 (3 + 4) * 5 = 35 </Paragraph>
				</Formula>
			</ExampleSection>
		</GeneralSection>
		<GeneralSection><SectionTitle>FUNCTIONS</SectionTitle>
			<GeneralSection><SectionTitle>Arithmetic functions:</SectionTitle>
				<TABLE border="1"><TBODY><TR><TD>round(X,Y,Z)</TD>
							<TD>round off X value</TD>
						</TR>
						<TR><TD>-</TD>
							<TD>Y the number of decimals</TD>
						</TR>
						<TR><TD>-</TD>
							<TD>Z rounding method (down = 0, normal = 1, up = 2)</TD>
						</TR>
						<TR><TD>abs(X)</TD>
							<TD>absolute value of X (abs(-10.3) = 10.3)</TD>
						</TR>
						<TR><TD>int(X)</TD>
							<TD>full value of X (int(11.6) = 11 )</TD>
						</TR>
						<TR><TD>pow(X,Y)</TD>
							<TD>involution (pow(10,2) = 100 )</TD>
						</TR>
						<TR><TD>sqrt(X)</TD>
							<TD>root of X (sqrt(16) = 4 )</TD>
						</TR>
						<TR><TD>min(X,Y)</TD>
							<TD>smallest values of X and Y (min(6,10) = 6 )</TD>
						</TR>
						<TR><TD>max(X,Y)</TD>
							<TD>largest values of X and Y (max(6,10) = 10 )</TD>
						</TR>
						<TR><TD>pi</TD>
							<TD>constant with PI value (3.1415926... )</TD>
						</TR>
					</TBODY>
				</TABLE>
			</GeneralSection>
			<GeneralSection><SectionTitle>Goniometric functions:</SectionTitle>
				<TABLE border="1"><TBODY><TR><TD>sin(X), cos(X), tan(X)</TD>
							<TD>sine, cosine, or tangent of X (radians)</TD>
						</TR>
						<TR><TD>asin(X), acos(X), atan(X)</TD>
							<TD>arcsine, arccosine, or arctangent of X</TD>
						</TR>
						<TR><TD>hsin(X), hcos(X), htan(X)</TD>
							<TD>sine-, cosine-, or tangent-hyperbolicus of X</TD>
						</TR>
					</TBODY>
				</TABLE>
			</GeneralSection>
			<GeneralSection><SectionTitle>Logarithmic functions:</SectionTitle>
				<TABLE border="1"><TBODY><TR><TD>exp(X)</TD>
							<TD>e-power of X</TD>
						</TR>
						<TR><TD>log(X)</TD>
							<TD>natural logarithm of X with base e</TD>
						</TR>
						<TR><TD>log10(X)</TD>
							<TD>logarithmic value of X with base 10</TD>
						</TR>
						<TR><TD>time</TD>
							<TD>current time</TD>
						</TR>
						<TR><TD>date</TD>
							<TD>current date</TD>
						</TR>
						<TR><TD>date(d,m,y)</TD>
							<TD>date expressed as day, month, and year</TD>
						</TR>
					</TBODY>
				</TABLE>
				<Paragraph>For example, date(1,5,1991) = May 1 1991</Paragraph>
			</GeneralSection>
			<GeneralSection><SectionTitle>Date functions:</SectionTitle>
				<TABLE border="1"><TBODY><TR><TD>time</TD>
							<TD>current time</TD>
						</TR>
						<TR><TD>date</TD>
							<TD>current date</TD>
						</TR>
						<TR><TD>date(d,m,y)</TD>
							<TD>date expressed as day, month, and year</TD>
						</TR>
					</TBODY>
				</TABLE>
				<Paragraph>For example, date(1,5,1991) = May 1 1991</Paragraph>
				<TABLE border="1"><TBODY><TR><TD>exp(X)</TD>
							<TD>e-power of X</TD>
						</TR>
						<TR><TD>log(X)</TD>
							<TD>natural logarithm of X with base e</TD>
						</TR>
						<TR><TD>log10(X)</TD>
							<TD>logarithmic value of X with base 10</TD>
						</TR>
					</TBODY>
				</TABLE>
			</GeneralSection>
			<ExampleSection><SectionTitle>Example</SectionTitle>
				<Formula><Paragraph UserLevel="Novice" UserType="Taskuser"> 5 IN [12,30] = 0 15 IN [12,30] = 1 </Paragraph>
				</Formula>
			</ExampleSection>
		</GeneralSection>
	</GeneralSection>
</ManualTopic>
