Basic Constants /text/sbasic/shared/03040000.xhp
Pi;Basic constant Null;Basic constant Empty;Basic constant Nothing;Basic constant Basic constant;Nothing Basic constant;Null Basic constant;Empty Basic constant;Pi Basic constant;False Basic constant;True Basic Constants Constants used in Basic programs
Boolean constants Name Type Value True Boolean 1 False Boolean 0
Example Dim bPositive as Boolean bPositive = True Mathematical constant Name Type Value Pi Double 3.14159265358979
Example Function Rad2Deg( aRad as Double) As Double Rad2Deg = aRad * 180.00 / Pi End Function Object Constants Name Type Usage Empty Variant The Empty value indicates that the variable is not initialized. Null null Indicates that the variable does not contain data. Nothing Object Assign the Nothing object to a variable to remove a previous assignment.
Example SubExampleEmpty Dim sVar As Variant sVar = Empty Print IsEmpty(sVar) ' Returns True End Sub Sub ExampleNull Dim vVar As Variant MsgBox IsNull(vVar) End Sub Sub ExampleNothing Dim oDoc As Object Set oDoc = ThisComponent Print oDoc.Title oDoc = Nothing Print oDoc ‘ Error End Sub