Navision - How to find out Square Root / Cube Root?

We all know how to raise a number to the power n. Use the powerful nummeric function 'Power'.

NewNumber := POWER(Number, Power);
So Power(4,2) will result in 16.


But how to find out the roots (square, cuber or nth root)?

Simple use the same Power function - And just change the 'Power' parameter of the function.

So to find out the square root of say 16, use

Power(16,1/2); This will result in 4

to find out the Cube root of say 8, use

Power(16,1/3); This will result in 2.

to find out the nth root of any number just use -

NewNumber := Power(Number,1/n);

How to indent multiple lines of code in Navision

What to do if you need to indent several lines of Code (Just because youmade the changes in code lately) in any Navision Object? Will you do it manually one line at a time?

Don't despair. There is a simple way to do it -

To indent several lines of code, select those several lines and press TAB. The code indents with two spaces to the right, every time that TAB is pressed.

To indent several lines of code to the left, select those lines, and press SHIFT+TAB. This indents the code with one space to the left, every time that SHIFT+TAB is pressed.

Block indentation enables developers to indent several lines of code in only three keystrokes (one for highlighting the code and two for pressing SHIFT and TAB.)