Basic Constants/text/sbasic/shared/03040000.xhpPi;Basic constantNull;Basic constantEmpty;Basic constantNothing;Basic constantBasic constant;NothingBasic constant;NullBasic constant;EmptyBasic constant;PiBasic constant;FalseBasic constant;TrueBasic ConstantsConstants used in Basic programsBoolean constants
NameTypeValueTrueBoolean1FalseBoolean0
ExampleDim bPositive as BooleanbPositive = TrueMathematical constant
NameTypeValuePiDouble3.14159265358979
ExampleFunction Rad2Deg( aRad as Double) As DoubleRad2Deg = aRad * 180.00 / PiEnd FunctionObject Constants
NameTypeUsageEmptyVariantThe Empty value indicates that the variable is not initialized.NullnullIndicates that the variable does not contain data.NothingObjectAssign the Nothing object to a variable to remove a previous assignment.
ExampleSubExampleEmptyDim sVar As Variant sVar = Empty Print IsEmpty(sVar) ' Returns TrueEnd SubSub ExampleNullDim vVar As Variant MsgBox IsNull(vVar)End SubSub ExampleNothingDim oDoc As Object Set oDoc = ThisComponent Print oDoc.Title oDoc = Nothing Print oDoc ‘ ErrorEnd Sub