<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.harlamenkov.ru/index.php?action=history&amp;feed=atom&amp;title=EN%2Fdocumentation%2Fbasic_guide%2Fconstants</id>
	<title>EN/documentation/basic guide/constants - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.harlamenkov.ru/index.php?action=history&amp;feed=atom&amp;title=EN%2Fdocumentation%2Fbasic_guide%2Fconstants"/>
	<link rel="alternate" type="text/html" href="https://wiki.harlamenkov.ru/index.php?title=EN/documentation/basic_guide/constants&amp;action=history"/>
	<updated>2026-11-11T13:56:20Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.33.0</generator>
	<entry>
		<id>https://wiki.harlamenkov.ru/index.php?title=EN/documentation/basic_guide/constants&amp;diff=15885&amp;oldid=prev</id>
		<title>Sancho: Created page with &quot;&lt;section begin=title /&gt;&lt;noinclude&gt;{{DISPLAYTITLE:&lt;/noinclude&gt;Constants&lt;noinclude&gt;}}&lt;/noinclude&gt;&lt;section end=title /&gt;{{BreadCrumbL10n}}  {{Documentation/BASICGuideTOC |ShowPrevNex...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.harlamenkov.ru/index.php?title=EN/documentation/basic_guide/constants&amp;diff=15885&amp;oldid=prev"/>
		<updated>2011-09-01T14:23:20Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;section begin=title /&amp;gt;&amp;lt;noinclude&amp;gt;{{DISPLAYTITLE:&amp;lt;/noinclude&amp;gt;Constants&amp;lt;noinclude&amp;gt;}}&amp;lt;/noinclude&amp;gt;&amp;lt;section end=title /&amp;gt;{{BreadCrumbL10n}}  {{Documentation/BASICGuideTOC |ShowPrevNex...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;section begin=title /&amp;gt;&amp;lt;noinclude&amp;gt;{{DISPLAYTITLE:&amp;lt;/noinclude&amp;gt;Constants&amp;lt;noinclude&amp;gt;}}&amp;lt;/noinclude&amp;gt;&amp;lt;section end=title /&amp;gt;{{BreadCrumbL10n}}&lt;br /&gt;
&lt;br /&gt;
{{Documentation/BASICGuideTOC&lt;br /&gt;
|ShowPrevNext=block&lt;br /&gt;
|ShowPrevPage=block&lt;br /&gt;
|PrevPage=EN/documentation/basic_guide/scope_of_variables&lt;br /&gt;
|NextPage=EN/documentation/basic_guide/operators&lt;br /&gt;
|lang=block&lt;br /&gt;
}}&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
Constants are values which may be used but not changed by the program.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Defining Constants ==&lt;br /&gt;
In {{OOo}} Basic, use the keyword &amp;lt;tt&amp;gt;Const&amp;lt;/tt&amp;gt; to declare a constant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
Const A = 10&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also specify the constant type in the declaration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
Const B As Double = 10&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Scope of Constants ==&lt;br /&gt;
&lt;br /&gt;
Constants have the same scope as variables (see [[Documentation/BASIC Guide/Scope of Variables|Scope and Life Span of Variables]]), but the syntax is slightly different.  A &amp;lt;tt&amp;gt;Const&amp;lt;/tt&amp;gt; definition in the module header is available to the code in that module.  To make the definition available to other modules, add the &amp;lt;tt&amp;gt;Public&amp;lt;/tt&amp;gt; keyword.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
Public Const one As Integer = 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Predefined Constants ==&lt;br /&gt;
&lt;br /&gt;
{{OOo}} Basic predefines several constants. Among the most useful are:&lt;br /&gt;
*&amp;lt;tt&amp;gt;True&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;False&amp;lt;/tt&amp;gt;, for Boolean assignment statements&lt;br /&gt;
*&amp;lt;tt&amp;gt;PI&amp;lt;/tt&amp;gt; as a type &amp;lt;tt&amp;gt;Double&amp;lt;/tt&amp;gt; numeric value&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
Dim bHit as Boolean&lt;br /&gt;
bHit = True&lt;br /&gt;
&lt;br /&gt;
Dim dArea as Double, dRadius as Double&lt;br /&gt;
' ... (assign a value to dRadius)&lt;br /&gt;
dArea = PI * dRadius * dRadius&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
{{PDL1}}&lt;/div&gt;</summary>
		<author><name>Sancho</name></author>
		
	</entry>
</feed>