<?xml version="1.0" encoding="utf-8"?>
<ManualTopic ID="/baanerp/qm/onlinemanual/000004" xml:lang="en">
   <Header>
      <Title>Syntax for expressions</Title>
      <Keyword type="header" order="d1e1396381">
         <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>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" borderstyle="default" space-and-orientation="indented-estimated">
            <TBODY noTR="2">
               <TR no="1" isLast="false">
                  <TD rowspan="1" colspan="1">Correct</TD>
                  <TD rowspan="1" colspan="1">1D, TA, V1, and so on</TD>
               </TR>
               <TR no="2" isLast="true">
                  <TD rowspan="1" colspan="1">Incorrect</TD>
                  <TD rowspan="1" colspan="1">1d, Ta, ta, v1, and so on</TD>
               </TR>
            </TBODY>
         </TABLE>
      </ExampleSection>
      <GeneralSection>
         <SectionTitle>OPERATORS</SectionTitle>
         <GeneralSection>
            <SectionTitle>Arithmetic operators:</SectionTitle>
            <TABLE border="1" borderstyle="default" space-and-orientation="indented-estimated">
               <TBODY noTR="3">
                  <TR no="1" isLast="false">
                     <TD rowspan="1" colspan="1">* / + -</TD>
                     <TD rowspan="1" colspan="1">multiplication/division/addition/subtraction</TD>
                  </TR>
                  <TR no="2" isLast="false">
                     <TD rowspan="1" colspan="1">\</TD>
                     <TD rowspan="1" colspan="1">remainder after division</TD>
                  </TR>
                  <TR no="3" isLast="true">
                     <TD rowspan="1" colspan="1">&amp;</TD>
                     <TD rowspan="1" colspan="1">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" borderstyle="default" space-and-orientation="indented-estimated">
               <TBODY noTR="6">
                  <TR no="1" isLast="false">
                     <TD rowspan="1" colspan="1">=</TD>
                     <TD rowspan="1" colspan="1">equal to</TD>
                  </TR>
                  <TR no="2" isLast="false">
                     <TD rowspan="1" colspan="1">&lt;&gt;</TD>
                     <TD rowspan="1" colspan="1">not equal to</TD>
                  </TR>
                  <TR no="3" isLast="false">
                     <TD rowspan="1" colspan="1">&gt;</TD>
                     <TD rowspan="1" colspan="1">greater than</TD>
                  </TR>
                  <TR no="4" isLast="false">
                     <TD rowspan="1" colspan="1">&gt;=</TD>
                     <TD rowspan="1" colspan="1">greater than or equal to</TD>
                  </TR>
                  <TR no="5" isLast="false">
                     <TD rowspan="1" colspan="1">&lt;</TD>
                     <TD rowspan="1" colspan="1">less than</TD>
                  </TR>
                  <TR no="6" isLast="true">
                     <TD rowspan="1" colspan="1">&lt;=</TD>
                     <TD rowspan="1" colspan="1">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/>
            <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 space-and-orientation="indented-estimated">
               <Paragraph> 3 + 4 * 5 = 23 (3 + 4) * 5 = 35 </Paragraph>
            </Formula>
         </ExampleSection>
      </GeneralSection>
      <GeneralSection>
         <SectionTitle>FUNCTIONS</SectionTitle>
         <GeneralSection>
            <SectionTitle>Arithmetic functions:</SectionTitle>
            <TABLE border="1" borderstyle="default" space-and-orientation="indented-estimated">
               <TBODY noTR="10">
                  <TR no="1" isLast="false">
                     <TD rowspan="1" colspan="1">round(X,Y,Z)</TD>
                     <TD rowspan="1" colspan="1">round off X value</TD>
                  </TR>
                  <TR no="2" isLast="false">
                     <TD rowspan="1" colspan="1">-</TD>
                     <TD rowspan="1" colspan="1">Y the number of decimals</TD>
                  </TR>
                  <TR no="3" isLast="false">
                     <TD rowspan="1" colspan="1">-</TD>
                     <TD rowspan="1" colspan="1">Z rounding method (down = 0, normal = 1, up = 2)</TD>
                  </TR>
                  <TR no="4" isLast="false">
                     <TD rowspan="1" colspan="1">abs(X)</TD>
                     <TD rowspan="1" colspan="1">absolute value of X (abs(-10.3) = 10.3)</TD>
                  </TR>
                  <TR no="5" isLast="false">
                     <TD rowspan="1" colspan="1">int(X)</TD>
                     <TD rowspan="1" colspan="1">full value of X (int(11.6) = 11 )</TD>
                  </TR>
                  <TR no="6" isLast="false">
                     <TD rowspan="1" colspan="1">pow(X,Y)</TD>
                     <TD rowspan="1" colspan="1">involution (pow(10,2) = 100 )</TD>
                  </TR>
                  <TR no="7" isLast="false">
                     <TD rowspan="1" colspan="1">sqrt(X)</TD>
                     <TD rowspan="1" colspan="1">root of X (sqrt(16) = 4 )</TD>
                  </TR>
                  <TR no="8" isLast="false">
                     <TD rowspan="1" colspan="1">min(X,Y)</TD>
                     <TD rowspan="1" colspan="1">smallest values of X and Y (min(6,10) = 6 )</TD>
                  </TR>
                  <TR no="9" isLast="false">
                     <TD rowspan="1" colspan="1">max(X,Y)</TD>
                     <TD rowspan="1" colspan="1">largest values of X and Y (max(6,10) = 10 )</TD>
                  </TR>
                  <TR no="10" isLast="true">
                     <TD rowspan="1" colspan="1">pi</TD>
                     <TD rowspan="1" colspan="1">constant with PI value (3.1415926... )</TD>
                  </TR>
               </TBODY>
            </TABLE>
         </GeneralSection>
         <GeneralSection>
            <SectionTitle>Goniometric functions:</SectionTitle>
            <TABLE border="1" borderstyle="default" space-and-orientation="indented-estimated">
               <TBODY noTR="3">
                  <TR no="1" isLast="false">
                     <TD rowspan="1" colspan="1">sin(X), cos(X), tan(X)</TD>
                     <TD rowspan="1" colspan="1">sine, cosine, or tangent of X (radians)</TD>
                  </TR>
                  <TR no="2" isLast="false">
                     <TD rowspan="1" colspan="1">asin(X), acos(X), atan(X)</TD>
                     <TD rowspan="1" colspan="1">arcsine, arccosine, or arctangent of X</TD>
                  </TR>
                  <TR no="3" isLast="true">
                     <TD rowspan="1" colspan="1">hsin(X), hcos(X), htan(X)</TD>
                     <TD rowspan="1" colspan="1">sine-, cosine-, or tangent-hyperbolicus of X</TD>
                  </TR>
               </TBODY>
            </TABLE>
         </GeneralSection>
         <GeneralSection>
            <SectionTitle>Logarithmic functions:</SectionTitle>
            <TABLE border="1" borderstyle="default" space-and-orientation="indented-estimated">
               <TBODY noTR="6">
                  <TR no="1" isLast="false">
                     <TD rowspan="1" colspan="1">exp(X)</TD>
                     <TD rowspan="1" colspan="1">e-power of X</TD>
                  </TR>
                  <TR no="2" isLast="false">
                     <TD rowspan="1" colspan="1">log(X)</TD>
                     <TD rowspan="1" colspan="1">natural logarithm of X with base e</TD>
                  </TR>
                  <TR no="3" isLast="false">
                     <TD rowspan="1" colspan="1">log10(X)</TD>
                     <TD rowspan="1" colspan="1">logarithmic value of X with base 10</TD>
                  </TR>
                  <TR no="4" isLast="false">
                     <TD rowspan="1" colspan="1">time</TD>
                     <TD rowspan="1" colspan="1">current time</TD>
                  </TR>
                  <TR no="5" isLast="false">
                     <TD rowspan="1" colspan="1">date</TD>
                     <TD rowspan="1" colspan="1">current date</TD>
                  </TR>
                  <TR no="6" isLast="true">
                     <TD rowspan="1" colspan="1">date(d,m,y)</TD>
                     <TD rowspan="1" colspan="1">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" borderstyle="default" space-and-orientation="indented-estimated">
               <TBODY noTR="3">
                  <TR no="1" isLast="false">
                     <TD rowspan="1" colspan="1">time</TD>
                     <TD rowspan="1" colspan="1">current time</TD>
                  </TR>
                  <TR no="2" isLast="false">
                     <TD rowspan="1" colspan="1">date</TD>
                     <TD rowspan="1" colspan="1">current date</TD>
                  </TR>
                  <TR no="3" isLast="true">
                     <TD rowspan="1" colspan="1">date(d,m,y)</TD>
                     <TD rowspan="1" colspan="1">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" borderstyle="default" space-and-orientation="indented-estimated">
               <TBODY noTR="3">
                  <TR no="1" isLast="false">
                     <TD rowspan="1" colspan="1">exp(X)</TD>
                     <TD rowspan="1" colspan="1">e-power of X</TD>
                  </TR>
                  <TR no="2" isLast="false">
                     <TD rowspan="1" colspan="1">log(X)</TD>
                     <TD rowspan="1" colspan="1">natural logarithm of X with base e</TD>
                  </TR>
                  <TR no="3" isLast="true">
                     <TD rowspan="1" colspan="1">log10(X)</TD>
                     <TD rowspan="1" colspan="1">logarithmic value of X with base 10</TD>
                  </TR>
               </TBODY>
            </TABLE>
         </GeneralSection>
         <ExampleSection>
            <SectionTitle>Example</SectionTitle>
            <Formula space-and-orientation="indented-estimated">
               <Paragraph> 5 IN [12,30] = 0 15 IN [12,30] = 1 </Paragraph>
            </Formula>
         </ExampleSection>
      </GeneralSection>
   </GeneralSection>
</ManualTopic>