21.08.2013 Views

OpenOffice.org BASIC Guide.pdf - OpenOffice.org wiki

OpenOffice.org BASIC Guide.pdf - OpenOffice.org wiki

OpenOffice.org BASIC Guide.pdf - OpenOffice.org wiki

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Constants 24<br />

You can also specify the constant type in the declaration:<br />

Const B As Double = 10<br />

Scope of Constants<br />

Constants have the same scope as variables (see → Scope and Life Span of Variables), but<br />

the syntax is slightly different. A Const definition in the module header is available to the<br />

code in that module. To make the definition available to other modules, add the Public<br />

keyword.<br />

Public Const one As Integer = 1<br />

Source: http:/ / <strong>wiki</strong>. services. openoffice. <strong>org</strong>/ w/ index. php? title=Documentation/ <strong>BASIC</strong>_<br />

<strong>Guide</strong>/ Constants&oldid=96849<br />

Principal Authors: Fpe, Ccornell, TJFrazier<br />

Operators<br />

<strong>OpenOffice</strong>.<strong>org</strong> Basic understands common mathematical, logical, and comparison<br />

operators.<br />

Mathematical Operators<br />

Mathematical operators can be applied to all numbers types, whereas the + operator can<br />

also be used to link strings.<br />

+ Addition of numbers and date values, linking of strings<br />

& Link strings<br />

- Subtraction of numbers and date values<br />

* Multiplication of numbers<br />

/ Division of numbers<br />

\ Division of numbers with a whole number result (rounded)<br />

^ Raising the power of numbers<br />

MOD modulo operation (calculation of the remainder of a division)<br />

Although you can use the + operator to link strings, the + operator can become confused<br />

when linking a number to a string. The & operator is safer when dealing with strings<br />

because it assumes that all arguments should be strings, and converts the arguments to<br />

strings if they are not strings.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!