Guida di LibreOffice 25.2
Constanti usate nei programmi Basic
| Nome | Tipo | Valore | 
|---|---|---|
| True | Boolean | 1 | 
| False | Boolean | 0 | 
            Dim bPositive as Boolean
            bPositive = True
        | Nome | Tipo | Valore | 
|---|---|---|
| Pi | Double | 3.14159265358979 | 
            Function Rad2Deg( aRad as Double) As Double
             Rad2Deg = aRad * 180.00 / Pi
            End Function
        | Nome | Tipo | Uso | 
|---|---|---|
| Empty | Variant | Il valore Empty indica che la variabile non è inizializzata. | 
| Null | null | Indica che la variabile non contiene dati. | 
| Nothing | Object | Assegna l'oggetto Nothing a una variabile per rimuovere l'assegnazione precedente. | 
            SubExampleEmpty
                Dim sVar As Variant
                sVar = Empty
                Print IsEmpty(sVar) ' Restituisce 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 ' Errore
            End Sub
        Quando è attivato il modo compatibilità VBA sono disponibili le seguenti costanti
| Costante con nome | Composizione RGB | 
|---|---|
| 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) | 
| Costante con nome | Valore decimale | 
|---|---|
| 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 | 
| Costante con nome | Valore (decimale) esadecimale | Descrizione | 
|---|---|---|
| vbTrue | -1 | Parte della enumerazione vbTriState. | 
| vbFalse | 0 | Parte della enumerazione vbTriState. | 
| vbUseDefault | -2 | Parte della enumerazione vbTriState. | 
| vbCr | \x0D (13) | CR - Carriage return (ritorno a capo) | 
| vbCrLf | \x0D\x0A (13 10) | CRLF - Carriage return and line feed (ritorno a capo e nuova riga) | 
| vbFormFeed | \x0c (12) | FF - Form feed (salto di pagina) | 
| vbLf | \x0A (10) | LF - Line feed (nuova riga) | 
| vbNewLine | \x0D\x0A (13 10) per Windows \x0A (10) per altri sistemi | LF o CRLF | 
| vbNullString | "" | Stringa Null | 
| vbTab | \x09 (9) | HT - Tabulazione orizzontale | 
| vbVerticalTab | \x0B (11) | VT - Tabulazione verticale |