Conteníu
Índiz 🔎︎

# TypeName Function; VarType Function

Devuelve una cadena (TypeName) o un valor numbéricu (VarType) que contién información pa una variable.

### Syntax:

    TypeName (Variable) / VarType (Variable)

### Return value:

String; Integer

### Parameters:

Variable: La variable de la que se deseya determinar el so tipu. Puen usase los valores siguientes:

Pallabra clave | Named constant | VarType | Tipu de variable
--- | --- | --- | ---
Boolean |  | 11 | Variable booleana
Byte |  | 17 | Byte variable
Date | V_DATE | 7 | Variable de fecha
Currency | V_CURRENCY | 6 | Currency variable
Double | V_DOUBLE | 5 | Variable doble de coma flotante
Integer | V_INTEGER | 2 | Variable entera
Long | V_LONG | 3 | Variable entera llarga
Object |  | 9 | Variable d'oxetu
Single | V_SINGLE | 4 | Variable simple de coma flotante
String | V_STRING | 8 | Variable de cadena
Variant |  | 12 | Variable variante (pue contener tolos tipos especificaos pola definición)
Empty | V_EMPTY | 0 | La variable nun ta inicializada
Null | V_NULL | 1 | Nun hai datos válidos

### Error codes:

5 Llamada a procedimientu non válida

### Example:

    Sub ExampleType
    Dim iVar As Integer
    Dim sVar As String
    Dim siVar As Single
    Dim dVar As Double
    Dim bVar As Boolean
    Dim lVar As Long
    Dim cVar as Currency
    Dim tVar as Date
     MsgBox TypeName(iVar) & " " & VarType(iVar) & Chr(13) &_
     TypeName(sVar) & " " & VarType(sVar) & Chr(13) &_
     TypeName(siVar) & " " & VarType(siVar) & Chr(13) &_
     TypeName(dVar) & " " & VarType(dVar) & Chr(13) &_
     TypeName(bVar) & " " & VarType(bVar) & Chr(13) &_
     TypeName(cVar) & " " & VarType(cVar) & Chr(13) &_
     TypeName(tVar) & " " & VarType(tVar) & Chr(13) &_
     TypeName(lVar) & " " & VarType(lVar),0,"Dellos tipos en LibreOffice Basic"
    End Sub