{"id":661,"date":"2019-05-15T07:07:31","date_gmt":"2019-05-15T07:07:31","guid":{"rendered":"https:\/\/helpdesk.reden.nl\/revesdse\/?page_id=661"},"modified":"2025-02-10T10:52:46","modified_gmt":"2025-02-10T10:52:46","slug":"syntax","status":"publish","type":"page","link":"https:\/\/docs.reden.nl\/reves\/syntax\/","title":{"rendered":"Syntax"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"General-syntax\"><span class=\"ez-toc-section\" id=\"general-syntax\"><\/span>General syntax<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"Reserved-keywords\"><span class=\"ez-toc-section\" id=\"reserved-keywords\"><\/span>Reserved keywords<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>These reserved keywords are predefined reserved words with special meaning for the compiler. Apart from the <a title=\"Expression\" href=\"#mathematical-functions\">mathematical functions<\/a> and <a href=\"#procedure-functions\">procedure functions<\/a> there are some predefined words with special meaning to the compiler. The list of keywords is shown below.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>array<\/code><\/li>\n\n\n\n<li><code>double<\/code><\/li>\n\n\n\n<li><code>else<\/code><\/li>\n\n\n\n<li><code>end<\/code><\/li>\n\n\n\n<li><code>exit<\/code><\/li>\n\n\n\n<li><code>for<\/code><\/li>\n\n\n\n<li><code>from<\/code><\/li>\n\n\n\n<li><code>if<\/code><\/li>\n\n\n\n<li><code>int<\/code><\/li>\n\n\n\n<li><code>then<\/code><\/li>\n\n\n\n<li><code>to<\/code><\/li>\n\n\n\n<li><code>pi; reserved for the mathematical \u03c0\u22483.14159...<\/code><\/li>\n<\/ul>\n\n\n\n<div class=\"wp-block-columns is-not-stacked-on-mobile has-border-color has-custom-color-1-border-color has-custom-color-2-background-color has-background is-layout-flex wp-container-core-columns-is-layout-44468703 wp-block-columns-is-layout-flex\" style=\"border-width:1px;padding-top:var(--wp--preset--spacing--10);padding-right:var(--wp--preset--spacing--10);padding-bottom:var(--wp--preset--spacing--10);padding-left:var(--wp--preset--spacing--10)\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:5%\">\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"\/wp-content\/uploads\/sites\/2\/note.png\" alt=\"\" class=\"wp-image-154\"\/><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:95%\">\n<p>Please be aware that in an expression, the typed &#8220;pi&#8221; represents a constant value, whereas the Greek symbol &#8220;\u03c0&#8221; serves as a variable parameter. Both will appear as &#8220;\u03c0&#8221; in the formatted expressions on the canvas, which may cause confusion.<\/p>\n<\/div>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"unit-syntax\"><span class=\"ez-toc-section\" id=\"unit-syntax\"><\/span>Unit syntax<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In DSE , you can give a parameter a unit, and this unit is formed by mixing basic units such as meters, seconds, kilograms, and Kelvin using only multiplication (*), division (\/), and power (^) operations in an equation. &nbsp;To make sure the equation and any unit conversions stay simple, you&#8217;re not allowed to use addition or subtraction in it. Here are some examples of valid units:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>m\/s<\/code><\/li>\n\n\n\n<li><code>kg* m\/s^2<\/code><\/li>\n<\/ul>\n\n\n\n<p>Apart from these base units you also have some unit combinations which have their own name and symbol. Lots of those are contained in the SI unit list and are also available in DSE to use in the parameter unit definition.&nbsp; Here are some examples of valid units using non base SI units:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>N\/m^2<\/code><\/li>\n\n\n\n<li><code>L\/s<\/code><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"Custom-base-units\"><span class=\"ez-toc-section\" id=\"custom-base-units\"><\/span>Custom base units<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Additionally, if DSE does not contain the unit which you want to use and\/or it is not possible to define the unit with an equation with only multiplication (*), division (\/), and power (^) operations you can define a custom user base unit. This can be done in the <a href=\"\/reves\/creating-the-model\/#using-the-units-manager\"><em>Units Manager<\/em> window&nbsp;<\/a> or from the unit popup window that you get when you edit a unit by clicking the <strong><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-979\" src=\"\/wp-content\/uploads\/sites\/4\/newUnit.png\" alt=\"\" width=\"16\" height=\"16\"> Add a base unit button.<\/strong><\/p>\n\n\n\n<p>A custom user base unit definition usually contains an existing unit or units and some addition multiplication factor and a value shift. A simple custom user base unit definition follows the following format <span style=\"background-color: #f2f4f5; color: #222222; font-family: Inconsolata, monospace;\">[factor] * or \/ [base unit or combined units] + or &#8211; [shift]<\/span>. An example of a custom user base unit definition following this format and using existing units would be :<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>2*N*K\/m+5<\/code><\/li>\n\n\n\n<li><code>1\/(m*Pa)-6<\/code>.<\/li>\n<\/ul>\n\n\n\n<p>The exact rules for custom user base unit are:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Unit symbols in the <code>[base unit or combined units]<\/code> section must be separated by either a multiplication (<code>*<\/code>) or division (<code>\/<\/code>)&nbsp; operator.<\/li>\n\n\n\n<li>Any number (factor, shift or power) in the unit text must be separated from the unit symbols with either a multiplication (<code>*<\/code>), division (<code>\/<\/code>), addition (<code>+<\/code>) , subtraction (<code>-<\/code>) or power (<code><tt>^<\/tt><\/code>) operator<\/li>\n<\/ul>\n\n\n\n<p>Each custom user base unit definition requires a symbol to associate with this unit. This unit can then be used in a parameter unit definition as usually.&nbsp; Here are some examples of valid custom user base units, their symbol and the possible unit symbol usage with parameters:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>light year; symbol <code>ly<\/code>\n<ul class=\"wp-block-list\">\n<li><code>ly= <span class=\"nowrap\">&nbsp;<\/span><span class=\"nowrap\">9.4607\u00d710^15*m<\/span><\/code><\/li>\n\n\n\n<li>Usage: <code>ly<\/code><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>atmosphere; symbol <code>atm<\/code>\n<ul class=\"wp-block-list\">\n<li><code>atm = 1.013*10^5*Pa<\/code><\/li>\n\n\n\n<li>Usage: <code>atm<\/code><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>calorie; symbol <code>cal<\/code>\n<ul class=\"wp-block-list\">\n<li><code>cal = 4.184*J<\/code><\/li>\n\n\n\n<li>Usage: <code>cal\/kg<\/code><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"Prefixes\"><span class=\"ez-toc-section\" id=\"prefixes\"><\/span>Prefixes<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>You can prefix any prefix-able unit symbol by typing one of the prefix symbols listed below directly in front of the unit symbol (without any spaces). Some of these default prefixes have been left out of Reves to decrease the amount of conflicts with potential custom units like imperial units.<\/p>\n\n\n\n<div class=\"wp-block-columns is-not-stacked-on-mobile has-border-color has-custom-color-1-border-color has-custom-color-2-background-color has-background is-layout-flex wp-container-core-columns-is-layout-44468703 wp-block-columns-is-layout-flex\" style=\"border-width:1px;padding-top:var(--wp--preset--spacing--10);padding-right:var(--wp--preset--spacing--10);padding-bottom:var(--wp--preset--spacing--10);padding-left:var(--wp--preset--spacing--10)\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:5%\">\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"\/wp-content\/uploads\/sites\/2\/note.png\" alt=\"\" class=\"wp-image-154\"\/><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:95%\">\n<p>Custom made unit are not automatically prefix-able with the symbols below to prevent the amount of possible unit symbol collisions. If a prefix-able custom unit is required, a new unit can be made using a conversion factor and the existing custom unit.<\/p>\n<\/div>\n<\/div>\n\n\n\n<p class=\"has-text-align-center\"><strong>SI unit prefixes<\/strong><\/p>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-table\"><table><thead><tr><th>Factor<\/th><th>Name<\/th><th>Symbol<\/th><\/tr><\/thead><tbody><tr><td><del>10<sup>24<\/sup><\/del><\/td><td><del>yotta<\/del><\/td><td><del>Y<\/del><\/td><\/tr><tr><td><del>10<sup>21<\/sup><\/del><\/td><td><del>zetta<\/del><\/td><td><del>Z<\/del><\/td><\/tr><tr><td>10<sup>18<\/sup><\/td><td>exa<\/td><td>E<\/td><\/tr><tr><td>10<sup>15<\/sup><\/td><td>peta<\/td><td>P<\/td><\/tr><tr><td>10<sup>12<\/sup><\/td><td>tera<\/td><td>T<\/td><\/tr><tr><td>10<sup>9<\/sup><\/td><td>giga<\/td><td>G<\/td><\/tr><tr><td>10<sup>6<\/sup><\/td><td>mega<\/td><td>M<\/td><\/tr><tr><td>10<sup>3<\/sup><\/td><td>kilo<\/td><td>k<\/td><\/tr><tr><td>10<sup>2<\/sup><\/td><td>hecto<\/td><td>h<\/td><\/tr><tr><td>10<sup>1<\/sup><\/td><td>deka<\/td><td>da<\/td><\/tr><\/tbody><\/table><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-table\"><table><thead><tr><th>Factor<\/th><th>Name<\/th><th>Symbol<\/th><\/tr><\/thead><tbody><tr><td>10<sup>-1<\/sup><\/td><td>deci<\/td><td>d<\/td><\/tr><tr><td>10<sup>-2<\/sup><\/td><td>centi<\/td><td>c<\/td><\/tr><tr><td>10<sup>-3<\/sup><\/td><td>milli<\/td><td>m<\/td><\/tr><tr><td>10<sup>-6<\/sup><\/td><td>micro<\/td><td>\u00b5<\/td><\/tr><tr><td>10<sup>-9<\/sup><\/td><td>nano<\/td><td>n<\/td><\/tr><tr><td>10<sup>-12<\/sup><\/td><td>pico<\/td><td>p<\/td><\/tr><tr><td><del>10<sup>-15<\/sup><\/del><\/td><td><del>femto<\/del><\/td><td><del>f<\/del><\/td><\/tr><tr><td><del>10<sup>-18<\/sup><\/del><\/td><td><del>atto<\/del><\/td><td><del>a<\/del><\/td><\/tr><tr><td><del>10<sup>-21<\/sup><\/del><\/td><td><del>zepto<\/del><\/td><td><del>z<\/del><\/td><\/tr><tr><td><del>10<sup>-24<\/sup><\/del><\/td><td><del>yocto<\/del><\/td><td><del>y<\/del><\/td><\/tr><\/tbody><\/table><\/figure>\n<\/div>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"Expression-syntax\"><span class=\"ez-toc-section\" id=\"expression-syntax\"><\/span>Expression syntax<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"Symbols\"><span class=\"ez-toc-section\" id=\"symbols\"><\/span>Symbols<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><th colspan=\"3\"><b>&nbsp;Relational operators<\/b><\/th><\/tr><tr><td><tt>=<\/tt><\/td><td><tt>x = y<\/tt><\/td><td><tt>x<\/tt> equals <tt>y<\/tt><\/td><\/tr><tr><td><tt>&gt;<\/tt><\/td><td><tt>x &gt; y<\/tt><\/td><td><tt>x<\/tt> is larger than <tt>y<\/tt><\/td><\/tr><tr><td><tt>&lt;<\/tt><\/td><td><tt>x &lt; y<\/tt><\/td><td><tt>x<\/tt> is less than <tt>y<\/tt><\/td><\/tr><tr><td><tt>&lt;=<\/tt><\/td><td><tt>x &lt;= y<\/tt><\/td><td><tt>x<\/tt> is less than or equal to <tt>y<\/tt><\/td><\/tr><tr><td><tt>&gt;=<\/tt><\/td><td><tt>x &gt;= y<\/tt><\/td><td><tt>x<\/tt> is greater than or equal to <tt>y<\/tt><\/td><\/tr><tr><td><tt>&lt;&gt;<\/tt><\/td><td><tt>x &lt;&gt; y<\/tt><\/td><td><tt>x<\/tt>&nbsp; is not equal to <tt>y<\/tt><\/td><\/tr><tr><th colspan=\"3\">Mathematical operations<\/th><\/tr><tr><td><tt>+ <\/tt><\/td><td><tt>x + y<\/tt><\/td><td>add <tt>y<\/tt> to <tt>x<\/tt><\/td><\/tr><tr><td><tt>-<\/tt><\/td><td><tt>x - y<\/tt><\/td><td>subtract <tt>y<\/tt> from <tt>x<\/tt><\/td><\/tr><tr><td><tt>*<\/tt><\/td><td><tt>x * y<\/tt><\/td><td>multiply <tt>y<\/tt> with <tt>x<\/tt><\/td><\/tr><tr><td><tt>\/<\/tt><\/td><td><tt>x \/ y<\/tt><\/td><td>divide <tt>x<\/tt> by <tt>y<\/tt><\/td><\/tr><tr><td><tt>^<\/tt><\/td><td><tt>x ^ y<\/tt><\/td><td>raise <tt>x<\/tt> to the power <tt>y<\/tt><\/td><\/tr><tr><td><tt>%<\/tt><\/td><td><tt>x&nbsp;% y<\/tt><\/td><td>remainder of <tt>x<\/tt> divided by <tt>y<\/tt><\/td><\/tr><tr><td colspan=\"3\"><strong>Other functional symbols<\/strong><\/td><\/tr><tr><td><tt>[<\/tt><\/td><td><tt>x[index]<\/tt><\/td><td>Take the item at index <tt>index<\/tt> when <tt>x<\/tt> is an array parameter<\/td><\/tr><tr><td><tt>]<\/tt><\/td><td><tt>x[<tt>index<\/tt>]<\/tt><\/td><td>Take the item at index <tt>index<\/tt> when <tt>x<\/tt> is an array parameter<\/td><\/tr><tr><td><tt>(<\/tt><\/td><td><tt>(x + y) * z<\/tt><\/td><td>These symbols help us group different expressions or numbers together<\/td><\/tr><tr><td><tt>)<\/tt><\/td><td><tt>(x + y) * z<\/tt><\/td><td>Take the item at index <tt>index<\/tt> when <tt>x<\/tt> is an array parameter<\/td><\/tr><tr><td><tt>_<\/tt><\/td><td><tt>x_y<\/tt><\/td><td>Symbolic notation for subscripting <tt>y<\/tt> to <tt>x<\/tt> to get the notation: x<sub>y<\/sub><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Other allowed non functional symbols are:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Currency symbols<\/li>\n\n\n\n<li>!<\/li>\n\n\n\n<li>@<\/li>\n\n\n\n<li>#<\/li>\n\n\n\n<li>&amp;<\/li>\n\n\n\n<li>{ and }<\/li>\n\n\n\n<li>|<\/li>\n\n\n\n<li>~<\/li>\n\n\n\n<li>`<\/li>\n\n\n\n<li>;<\/li>\n\n\n\n<li>:<\/li>\n\n\n\n<li>&#8220;<\/li>\n\n\n\n<li>&#8216;<\/li>\n\n\n\n<li>?<\/li>\n\n\n\n<li>\\<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"Mathematical-functions\"><span class=\"ez-toc-section\" id=\"mathematical-functions\"><\/span>Mathematical functions<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><th colspan=\"3\"><b>Functions<\/b><\/th><\/tr><tr><td><tt>abs<\/tt><\/td><td><tt>abs(x)<\/tt><\/td><td>determines the absolute value of <tt>x<\/tt><\/td><\/tr><tr><td><tt>arccos<\/tt><\/td><td><tt>arccos(x)<\/tt><\/td><td>determines the angle<sup>(1)<\/sup> whose cosine is <tt>x<\/tt><\/td><\/tr><tr><td><tt>arcsin<\/tt><\/td><td><tt>arcsin(x)<\/tt><\/td><td>determines the angle<sup>(1)<\/sup> whose sine is <tt>x<\/tt><\/td><\/tr><tr><td><tt>arctan<\/tt><\/td><td><tt>arctan(x)<\/tt><\/td><td>determines the angle<sup>(1)<\/sup> whose tangent is <tt>x<\/tt><\/td><\/tr><tr><td><tt>arctan2<\/tt><\/td><td><tt>arctan2(y;x)<\/tt><\/td><td>determines the angle angle<sup>(1)<\/sup>\u00a0whose tangent is the quotient of y and x, where (<code>x<\/code>,\u00a0<code>y<\/code>) is a point in the Cartesian plane.<\/td><\/tr><tr><td><tt>besselJ<\/tt><\/td><td><tt>besselJ(n;x)<\/tt><\/td><td>Returns the Bessel function J_n(x) for any real <tt>x<\/tt> and integer <span style=\"font-family: Inconsolata, monospace;\">n <\/span>\u2265 0.<\/td><\/tr><tr><td><tt>besselY<\/tt><\/td><td><tt>besselY(n;x)<\/tt><\/td><td>Returns the Bessel function Y_n(x) for any positive <tt>x<\/tt> and integer <tt>n<\/tt> \u2265 0.<\/td><\/tr><tr><td><tt>ceiling<\/tt><\/td><td><tt>ceiling(x)<\/tt><\/td><td>determines the smallest integer value greater or equal to the provided value <tt>x<\/tt><\/td><\/tr><tr><td><tt>cos<\/tt><\/td><td><tt>cos(x)<\/tt><\/td><td>determines the cosine of angle <tt>x<\/tt> <sup>(1)<\/sup><\/td><\/tr><tr><td><tt>exp<\/tt><\/td><td><tt>exp(x)<\/tt><\/td><td>determines e raised to the power of <tt>x<\/tt><\/td><\/tr><tr><td><tt>floor<\/tt><\/td><td><tt>floor(x)<\/tt><\/td><td>determines the largest integer value smaller or equal to the provided value <tt>x<\/tt><\/td><\/tr><tr><td><tt>int<\/tt><\/td><td><tt>int(x)<\/tt><\/td><td>converts <tt>x<\/tt> to an integer by rounding the number down to the nearest integer. Use it with array parameters to make the indexer explicitly an integer.<\/td><\/tr><tr><td><tt>integrate<\/tt><\/td><td><tt>integrate(f(x);x;a;b)<\/tt><\/td><td>calculates the integral of f(x) from a to b with integrand <tt>x<\/tt> using the trapezoidal rule.&nbsp; In general this method of integration is faster with a slight loss of accuracy. The integrand cannot be a parameter. The lower (a) and upper (b) bound are allowed to be parameters.<\/td><\/tr><tr><td><tt>integrateMidpoint<\/tt><\/td><td><tt><tt>integrateMidpoint<\/tt>(f(x);x;a;b)<\/tt><\/td><td>calculates the integral of f(x) from a to b with integrand <tt>x<\/tt> using the midpoint rule. In general this method of integration is more accurate at the cost of speed. The integrand cannot be a parameter. The lower (a) and upper (b) bound are allowed to be parameters.<\/td><\/tr><tr><td><tt>length<\/tt><\/td><td><tt>length(x)<\/tt><\/td><td>gets the length of parameter <tt>x<\/tt>. Use it with array parameters to get the length of the array.<\/td><\/tr><tr><td><tt>log<\/tt><\/td><td><tt>log(x)<\/tt><\/td><td>determines the natural logarithm (ln, log<em><span style=\"font-family: Inconsolata, monospace;\">e<\/span><\/em> ) of <tt>x<\/tt><\/td><\/tr><tr><td><tt>log10<\/tt><\/td><td><tt>log10(x)<\/tt><\/td><td>determines the base 10 logarithm of <tt>x<\/tt><\/td><\/tr><tr><td><tt>max<\/tt><\/td><td><tt>max(x; y)<\/tt><\/td><td>determines the larger value of <tt>x<\/tt> and <tt>y<\/tt><\/td><\/tr><tr><td><tt>min<\/tt><\/td><td><tt>min(x; y)<\/tt><\/td><td>determines the smaller value of <tt>x<\/tt> and <tt>y<\/tt><\/td><\/tr><tr><td><tt>sin<\/tt><\/td><td><tt>sin(x)<\/tt><\/td><td>determines the sinus of angle <tt>x<\/tt> <sup>(1)<\/sup><\/td><\/tr><tr><td><tt>sqrt<\/tt><\/td><td><tt>sqrt(x)<\/tt><\/td><td>determines the square root of x<\/td><\/tr><tr><td><tt>sum<\/tt><\/td><td><tt>sum(x)<\/tt><\/td><td>gets the sum of the <tt>x <\/tt>values. Use it with array parameters to get the sum of all it&#8217;s indices.<\/td><\/tr><tr><td><tt>tan<\/tt><\/td><td><tt>tan(x)<\/tt><\/td><td>determines the tangent of angle <tt>x<\/tt> <sup>(1)<\/sup><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><sup>(1)<\/sup>&nbsp;Angle in radians.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"Parameter-syntax\"><span class=\"ez-toc-section\" id=\"parameter-syntax\"><\/span>Parameter syntax<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>An parameter symbol in an expression has to adhear to the following syntax rules:<\/p>\n\n\n\n<p>It can:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>start with a underscore &#8220;_&#8221;.<\/li>\n\n\n\n<li>contain both upper case and lower case unicode letters. Case is significant.<\/li>\n\n\n\n<li>contain &#8216;letters&#8217; from foreign scripts like greek, asian, arabic etc.<\/li>\n<\/ul>\n\n\n\n<p>It cannot:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>start with a numeral.<\/li>\n\n\n\n<li>start with a symbol.<\/li>\n\n\n\n<li>contain a space.<\/li>\n\n\n\n<li>contain emoji&#8217;s<\/li>\n\n\n\n<li>contain symbols outside the allowed<a href=\"#expression-syntax\"> (operator) symbols&nbsp;<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"Procedure-syntax\"><span class=\"ez-toc-section\" id=\"procedure-syntax\"><\/span>Procedure syntax<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"Procedure-functions\"><span class=\"ez-toc-section\" id=\"procedure-functions\"><\/span>Procedure functions<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><th colspan=\"3\"><b>Functions<\/b><\/th><\/tr><tr><td><tt>array<\/tt><\/td><td><tt><tt>array<\/tt>(length, val)<\/tt><\/td><td>create and fill an array value item of length <code>length<\/code> with the value <code>val<\/code> at each index position<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"Identifier\"><span class=\"ez-toc-section\" id=\"identifier\"><\/span>Identifier<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>An identifier is an element in the code that is not a keyword, operator, or numeric value. An identifier is always associated with a value. An identifier has to follow the same syntax convention as <a href=\"#parameter-syntax\">parameters in expressions<\/a>. In Reves DSE there are three kinds of identifiers:&nbsp; model parameters, the parameter to solve and local variables.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"Model-parameters\"><span class=\"ez-toc-section\" id=\"model-parameters\"><\/span><strong>Model parameters<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>The parameters that are defined in the model can be used in a procedure as input parameters. The procedure will be executed with the known values of the used model parameter.&nbsp; To use a model parameter, simply type its symbol in the code box. When an parameter is recognized as a model parameter, it is highlighted in <code><span style=\"color: orangered;\"><b>orange-red<\/b><\/span><\/code>.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"The-parameter-to-solve\"><span class=\"ez-toc-section\" id=\"the-parameter-to-solve\"><\/span><strong>The parameter to solve<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>The parameter to solve can either be an existing model parameter of a new parameter.&nbsp; In the last case this parameter to solve will also become a model parameters which is accessible outside of the procedure.&nbsp; When the code is executed the resulting value should be assigned to this parameter to enable the usage of this output value outside of the procedure.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"Local-variables\"><span class=\"ez-toc-section\" id=\"local-variables\"><\/span><strong>Local variables<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>Local variables are identifiers that only exist within the procedure. They are mostly used to shorten and simplify the code. They are declared by writing the variable&#8217;s type and name. Variables defined in a control structure are only known inside that control structure.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"Declare\"><span class=\"ez-toc-section\" id=\"declare\"><\/span><strong>Declare<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<pre class=\"wp-block-preformatted\"><span style=\"color: green;\">\/\/ Declaring a variable called 'index', of type 'int'<\/span><br><span style=\"color: blue;\"><b>int<\/b><\/span> index<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"Initialize\"><span class=\"ez-toc-section\" id=\"initialize\"><\/span><strong>Initialize<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>Initialization of a declared variable is available by either of the following two methods.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><span style=\"color: green;\">\/\/ Declaring a variable called 'index', of type 'int' and initializing the variable immediately<\/span>\n<span style=\"color: blue;\"><b>int<\/b><\/span> index = 42<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><span style=\"color: green;\">\/\/ Declaring a variable called 'index', of type 'int' and initializing the variable later<\/span><br><span style=\"color: blue;\"><b>int<\/b><\/span> index <br>index = 42<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"Control-structures\"><span class=\"ez-toc-section\" id=\"control-structures\"><\/span>Control structures<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"if-statement\"><span class=\"ez-toc-section\" id=\"if-statement\"><\/span><strong>if statement<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>The if statement is entered when the given condition is true.<\/p>\n\n\n\n<p>Simple if statement without else-block:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><span style=\"color: blue;\">if<\/span> i &gt; 0 <span style=\"color: blue;\">then<\/span><br>   <span style=\"color: green;\">\/\/ code performed if condition is met<\/span><br>   ...<br><span style=\"color: blue;\">end<\/span><\/pre>\n\n\n\n<p>If statement with else-block:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><span style=\"color: blue;\">if<\/span> i &gt; 0 <span style=\"color: blue;\">then<\/span><br>   <span style=\"color: green;\">\/\/ code performed if condition is met<\/span><br>   ...<br><span style=\"color: blue;\">else<\/span><br>   <span style=\"color: green;\">\/\/ code performed if condition is <i>not<\/i> met<\/span><br>   ...<br><span style=\"color: blue;\">end<\/span><\/pre>\n\n\n\n<p>If statement with else if-block and else-block:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><span style=\"color: blue;\">if<\/span> i &lt; 10 <span style=\"color: blue;\">then<\/span><br>   <span style=\"color: green;\">\/\/ code performed if <i>first<\/i> condition is met<\/span><br>   ...<br><span style=\"color: blue;\">else if<\/span> i &gt; 100 <span style=\"color: blue;\">then<\/span><br>   <span style=\"color: green;\">\/\/ code performed if <i>second<\/i> condition is met<\/span><br>   ...<br><span style=\"color: blue;\">else<\/span><br>   <span style=\"color: green;\">\/\/ code performed if both <i>first<\/i> <b>and<\/b> <i>second<\/i> condition are <i>not<\/i> met<\/span><br>   ...<br><span style=\"color: blue;\">end<\/span><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"for-statement\"><span class=\"ez-toc-section\" id=\"for-statement\"><\/span><strong>for statement<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>The for loop is based on an iterator with is defined in three parts:&nbsp;<i>declaration<\/i>,&nbsp;<i>start value<\/i> (inclusive lower-bound) and <i>end value<\/i> (inclusive upper bound). The start and end values have to be<strong> integer values<\/strong> and can contain <strong>parameters<\/strong> or <strong>small equations<\/strong>. If the used value is not recognized as an integer it is possible to transform it to one using the integer function (<code>int(x)<\/code>) . With each step of the loop, the iterator value is incremented with 1.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><span style=\"color: blue;\">for<\/span> i <span style=\"color: blue;\">from<\/span> 0 <span style=\"color: blue;\">to<\/span> 10<br>   <span style=\"color: green;\">\/\/ code performed for each iteration<\/span><br>   ...<br><span style=\"color: blue;\">end<\/span><\/pre>\n\n\n\n<p>It is possible to stop a for loop before the end value of the iterator is reached. To do this, call&nbsp;<code>exit<\/code>. Calling exit, will immediately stop the execution of the for loop.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><span style=\"color: blue;\">for<\/span> i <span style=\"color: blue;\">from<\/span> 0 <span style=\"color: blue;\">to<\/span> 10<br>   ...<br>   <span style=\"color: blue;\">if<\/span> i &gt; <span style=\"color: orangered;\">R1<\/span> <span style=\"color: blue;\">then<\/span> <br>      <span style=\"color: blue;\">exit<\/span><br>   <span style=\"color: blue;\">end<\/span><br>   ...<br><span style=\"color: blue;\">end<\/span><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"Code-comments\"><span class=\"ez-toc-section\" id=\"code-comments\"><\/span>Code comments<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Comments are marked by typing a double slash (<code>\/\/<\/code>). The double slash has to be the first character of the line (not counting spaces).<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><span style=\"color: green;\">\/\/ a comment<\/span><br><span style=\"color: blue;\">double<\/span> d1<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"Array-syntax\"><span class=\"ez-toc-section\" id=\"array-syntax\"><\/span>Array syntax<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>For details on the array syntax it is best to view the related <a href=\"\/reves\/array-calculations\/#syntax\">Array calculations syntax section<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>General syntax Reserved keywords These reserved keywords are predefined reserved words with special meaning for the compiler. Apart from the mathematical functions and procedure functions there are some predefined words with special meaning to the compiler. The list of keywords is shown below. Please be aware that in an expression, the typed &#8220;pi&#8221; represents a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-661","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/docs.reden.nl\/reves\/wp-json\/wp\/v2\/pages\/661","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/docs.reden.nl\/reves\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/docs.reden.nl\/reves\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/docs.reden.nl\/reves\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.reden.nl\/reves\/wp-json\/wp\/v2\/comments?post=661"}],"version-history":[{"count":9,"href":"https:\/\/docs.reden.nl\/reves\/wp-json\/wp\/v2\/pages\/661\/revisions"}],"predecessor-version":[{"id":1448,"href":"https:\/\/docs.reden.nl\/reves\/wp-json\/wp\/v2\/pages\/661\/revisions\/1448"}],"wp:attachment":[{"href":"https:\/\/docs.reden.nl\/reves\/wp-json\/wp\/v2\/media?parent=661"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}