TypeName Function; VarType Function

λ³€μˆ˜μ— λŒ€ν•œ 정보λ₯Ό ν¬ν•¨ν•˜λŠ” λ¬Έμžμ—΄(TypeName) λ˜λŠ” 숫자 κ°’(VarType)을 κ΅¬ν•©λ‹ˆλ‹€.

ꡬ문:


TypeName (Variable) / VarType (Variable)

λ°˜ν™˜ κ°’:

String; Integer

맀개 λ³€μˆ˜:

Variable: μœ ν˜•μ„ κ²°μ •ν•  λ³€μˆ˜μž…λ‹ˆλ‹€. λ‹€μŒ 값을 μ‚¬μš©ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

ν‚€μ›Œλ“œ

Named constant

VarType

λ³€μˆ˜ μœ ν˜•

Boolean

11

Boolean λ³€μˆ˜

Byte

17

Byte variable

Date

V_DATE

7

Date λ³€μˆ˜

Currency

V_CURRENCY

6

Currency variable

Double

V_DOUBLE

5

Double 뢀동 μ†Œμˆ˜μ  λ³€μˆ˜

Integer

V_INTEGER

2

Integer λ³€μˆ˜

Long

V_LONG

3

Long integer λ³€μˆ˜

Object

9

Object λ³€μˆ˜

Single

V_SINGLE

4

Single 뢀동 μ†Œμˆ˜μ  λ³€μˆ˜

String

V_STRING

8

String λ³€μˆ˜

Variant

12

Variant λ³€μˆ˜(μ •μ˜λ³„λ‘œ μ§€μ •λœ λͺ¨λ“  μœ ν˜•μ„ 포함할 수 있음)

Empty

V_EMPTY

0

λ³€μˆ˜κ°€ μ΄ˆκΈ°ν™”λ˜μ§€ μ•ŠμŒ

Null

V_NULL

1

μœ νš¨ν•œ 데이터 μ—†μŒ


Error codes:

5 잘λͺ»λœ ν”„λ‘œμ‹œμ € ν˜ΈμΆœμž…λ‹ˆλ‹€.

예:


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,"Some types in LibreOffice Basic"
End Sub

Please support us!