Basic Constants /text/sbasic/shared/03040000.xhp
Basic constants

Basic Constants

Constants used in Basic programs
Boolean Basic constants Basic constant;False Basic constant;True

Boolean constants

Name Type Value True Boolean 1 False Boolean 0
Dim bPositive as Boolean bPositive = True
Basic Mathematical constants Pi;Basic constant Basic constant;Pi

Mathematical constant

Name Type Value Pi Double 3.14159265358979
Function Rad2Deg( aRad as Double) As Double Rad2Deg = aRad * 180.00 / Pi End Function
Basic Object constants Empty;Basic constant Null;Basic constant Nothing;Basic constant Basic constant;Nothing Basic constant;Null Basic constant;Empty

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.
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

MsgBox Named Constants

GetAttr Named Constants

VarType Named Constants

Visual Basic constants VBA Exclusive constants

Additional VBA constants

The following constants are available when VBA compatibility mode is enabled
VBA Variable Type Named Constants

VBA Color Named Constants

Named constant Red, Green, Blue
composition
vbBlack RGB(0, 0, 0) vbBlue RGB(0, 0, 255) vbCyan RGB(0, 255, 255) vbGreen RGB(0, 255, 0) vbMagenta RGB(255, 0, 255) vbRed RGB(255, 0, 0) vbYellow RGB(255, 255, 0) vbWhite RGB(255, 255, 255)

Variable Type Named Constants

Named constant Decimal value vbArray 8192 vbBoolean 11 vbByte 17 vbCurrency 6 vbDataObject 13 vbDate 7 vbDecimal 14 vbDouble 5 vbEmpty 0 vbError 10 vbInteger 2 vbLong 3 vbNull 1 vbObject 9 vbSingle 4 vbString 8 vbUserDefinedType 36 vbVariant 12

FormatDateTime VBA Named Constants

StrConv VBA Named Constants

WeekDayName VBA Named Constants

Miscellaneous VBA Named Constants

Named constant Hexadecimal (decimal) value Description vbTrue -1 Part of vbTriState enumeration. vbFalse 0 Part of vbTriState enumeration. vbUseDefault -2 Part of vbTriState enumeration. vbCr \x0D (13) CR - Carriage return vbCrLf \x0D\x0A (13 10) CRLF - Carriage return and line feed vbFormFeed \x0c (12) FF - Form feed vbLf \x0A (10) LF - Line feed vbNewLine \x0D\x0A (13 10) for Windows \x0A (10) for other systems LF or CRLF vbNullString "" Null string vbTab \x09 (9) HT - Horizontal tab vbVerticalTab \x0B (11) VT - Vertical tab