Go Back

User login

Frontpage Sponsor


Google search

For ERP LN feature pack upgrade, what method of install are you using?
Installation Wizard into existing VRC
Installation Wizard into new VRC
Manual into existing VRC
Manual into new VRC
Total votes: 49

Baanboard at LinkedIn

Reference Content

Arithmetic operators
By patvdv at 26 Feb 2008 - 21:56

Arithmetic operators

Arithmetic operators perform arithmetic operations on the operands. All arithmetic operators, except string concatenation, must have operands of numerical type. If one of the two operands is a double, the other is also converted to double, and the result is also of double type. For example:

  45/30 is equal to 1
              | 45 and 30 are both LONG so the result is LONG
  45/30.0 is equal to 1.5
              | 30.0 is a DOUBLE so the result is a DOUBLE

The concatenation operator concatenates expressions, variables, or constants of string type.


        LONG lng_1, lng_2
        DOUBLE doub
        STRING strg_1(16), strg_2(50), strg_3(10), strg_4(20)

Expression Result
lng_2 = 8
The variable lng_2 contains 2, which is the remainder after dividing 8 by 3..
lng_1 = lng_2 + 3
The variable lng_1 now contains 5.
doub = lng_1 * 2.0
The variable lng_1 is multiplied by 2.0; the result (10.0) is stored in doub.
doub = 45 / 30
The variable doub now equals 1.0.

Note that 45 and 30 are both longs, so the result of the expression is 1. Converted to double for storing in the result, this becomes 1.0.
doub = 45 / 30.0
The variable doub now contains 1.5.
strg_1 = "hel" & "lo"

The variable strg_1 now contains the value "hello".

 strg_2 = strg_3 & strg_4

The contents of strg_3 and strg_4 are concatenated and placed in strg_2.

Related topics

No votes yet

All times are GMT +2. The time now is 21:47.

©2001-2018 - -