Notice that the BASIC Macro Functions are not always the same as Worksheet Functions. Worksheet Functions used as BASIC Macro Functions should be tested first. Select the following link for a complete list of worksheet functions.
https://wiki.openoffice.org/wiki/Documentation/How_Tos/Calc:_Functions_listed_by_category
In CHAPTER 9 we will go into more detail about commonly used BASIC functions. Below is a sampling of BASIC Math Functions.
Below is a sample program showing the use of built-in functions from the Calc Math Functions. Notice that degrees must be converted to radians for the trigonometric functions. The program uses the functions Cos(), Abs(), PI, and Int().
Sub myMathFunctions()
Dim x As Double
Dim y As Double
Dim z As Double
x = COS(30 * PI / 180) REM Convert to radians
MsgBox "Cos 30 degrees = " + x REM .866
y = ABS(-7)
MsgBox "Abs value of -7 is = " + y REM Absolute -7 is 7.
z = INT(5.14) REM Returns integer portion
MsgBox "5.14 is rounded to " + z
End Sub
Table of Contents
Ch1-Introduction
Ch2-Loops
Ch3-If Statements
Ch4-Functions
Ch5-Subs & Functions
Ch6-Read & Write
Ch7-Operators
Ch8-Built-in Functions
Ch9-Built-in Examples
Ch10-Debugging
Ch11-Running Subs
Ch12-Sample Programs
Ch13-WS Formulas
Ch14-WS Functions
Ch15-Calc Help Page