Did you know that the OpenOffice.org Wiki has a WYSIWYG editor? See Help:FCKeditor

定数

From OpenOffice.org Wiki

Jump to: navigation, search
doc OOo
Image:Book.png

定数とはプログラムで使用できますが、変更できない値です。

定数の定義

OpenOffice.org Basic で定数を宣言するには、キーワード Const を使用します。

Const A = 10

必要であれば、宣言時にデータ型を指定しておくこともできます。

Const B As Double = 10

定数の範囲

定数の範囲は変数と同じです (「変数の有効範囲と寿命」参照)。ただし、構文が若干異なります。モジュールヘッダの Const 定義は、そのモジュールのコードに対して使用できます。定義を他のモジュールでも使用可能にするには、キーワード Public を追加します。

Public Const one As Integer = 1


Content on this page is licensed under the Public Documentation License (PDL).
Personal tools
Create a book