Ajuda del LibreOffice 25.2
Constants utilitzades als programes Basic
| Nom | Tipus | Valor | 
|---|---|---|
| True | Boolean | 1 | 
| False | Boolean | 0 | 
            Dim bPositive as Boolean
            bPositive = True
        | Nom | Tipus | Valor | 
|---|---|---|
| Pi | Double | 3.14159265358979 | 
            Function Rad2Deg( aRad as Double) As Double
             Rad2Deg = aRad * 180.00 / Pi
            End Function
        | Nom | Tipus | Utilització | 
|---|---|---|
| Empty | Variant | El valor Buit indica que la variable no s'ha inicialitzat. | 
| Null | null | Indica que la variable no conté cap dada. | 
| Nothing | Object | Assigneu l'objecte Res a una variable per suprimir una assignació anterior. | 
            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
        Les constants següents estan disponibles quan s'activa el mode de compatibilitat VBA
| Constant amb nom | Composició de | 
|---|---|
| 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) | 
| Constant amb nom | Valor decimal | 
|---|---|
| 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 | 
| Constant amb nom | Valor hexadecimal (decimal) | Descripció | 
|---|---|---|
| vbTrue | -1 | Part de l'enumeració vbTriState. | 
| vbFalse | 0 | Part de l'enumeració vbTriState. | 
| vbUseDefault | -2 | Part de l'enumeració vbTriState. | 
| vbCr | \x0D (13) | CR - retorn de carro | 
| vbCrLf | \x0D\x0A (13 10) | CRLF - retorn de carro i avançament de línia | 
| vbFormFeed | \x0c (12) | FF - salt de pàgina | 
| vbLf | \x0A (10) | LF - avançament de línia | 
| vbNewLine | \x0D\x0A (13 10) for Windows \x0A (10) for other systems | LF o CRLF | 
| vbNullString | "" | Cadena nul·la | 
| vbTab | \x09 (9) | HT - tabulació horitzontal | 
| vbVerticalTab | \x0B (11) | VT - tabulació vertical |