Commit c072826f authored by Michael Van Canneyt's avatar Michael Van Canneyt
Browse files

* Fix issue 38866, add arithmetic operators to supported expressions in macro expressions

git-svn-id: trunk@1871 -
parent 9852ae71
......@@ -2913,6 +2913,12 @@ The following boolean operators are available:
\end{verbatim}
The IN operator tests for presence of a compile-time variable in a set.
In addition, the following arithmetic operators are available:
\begin{verbatim}
+, -, *, /, div, mod, shl, shr
\end{verbatim}
The usual precedence of operators applies.
The following functions are also available:
\begin{description}
\item[TRUE] Defined in MacPas mode only, it evaluates to True. In other
......@@ -3136,6 +3142,21 @@ begin
{$SETC TYPE_BOOL := FALSE}
{$ENDIF}
// Some arithmetic operators
{$IF (1 + 2) > 3}
{$fatal 'Wrong 1'}
{$ENDIF}
{$IF (2 mod 2)= 0}
(info 'Correct 2'}
{$ENDIF}
{$IF (2 div 2)= 1}
{$info 'Correct 3'}
{$ENDIF}
{$IF (1 shl 2)= 4}
{$info 'Correct 4'}
{$ENDIF}
{$info *************************************************}
{$info * Now have to follow at least 2 error messages: *}
{$info *************************************************}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment