Variant type - visual basic, Visual Basic Programming

Variant Type:

If no data type is related with the VB variables, it takes the default variant type. The variable x will be of the variant type when the two declarations below are used.

Dim x

Dim x as Variant

A variant type can take string, numeric, date, null or Boolean values.

Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As

Single)

Dim i As Integer

Dim j As Long

Dim a As Single

Dim b As Double

Dim c As Single

Dim c1 As Currency

i = 32767 ' range is upto 32767 beyond that overflow occurs

j = 97400

Form1.Print "integer i is"; i

Form1.Print "long j is"; j

a = 8.97655467787088 '8.976555

b = 0.876554677870879

c = 100000000 '1E+08

c1 = 100000000

Form1.Print "single a is"; a

Form1.Print "double b is"; b

Form1.Print "single c is"; c

Form1.Print "currency c1 is"; c1

End Sub

Posted Date: 10/9/2012 8:19:35 AM | Location : United States







Related Discussions:- Variant type - visual basic, Assignment Help, Ask Question on Variant type - visual basic, Get Answer, Expert's Help, Variant type - visual basic Discussions

Write discussion on Variant type - visual basic
Your posts are moderated
Related Questions
Methods: VBScript Err Object Clear Method Clears every property settings. Raise Method Generate a run-time error.

You can employ For...Next statements to run a block of statements a specific number of times. For loops, employ a counter variable whose value is increased or decreased with each r

Write a program to print a digital clock which displays the time for 2 hours . ..

Returns or sets the name of the object or application which generated the error originally. The Source property indicates a string expression which is usually the class name or pro


Events: The Controls are placed on a form and then to make them functional an "event procedure" is related with the control object. An event process is what happens in respons

Illustration of GDI object CPen: 1. Generate a SDI application. And name it as gdipen. 2. Press ctrl (control key) and W altogether to invoke the class wizard. 3. Choose

MODELESS DIALOG The Dialog boxes are either modal or modeless. The modal dialog box should be closed (Unloaded or hidden) before you can continue the working with the rest of t

Numeric data types: The Integer, long integer are used for entire numbers. Single and doubles are related with the floating point numbers. Currency is related with numbers dea

For reason of readability & consistency, employ the following prefixes along with descriptive names for variables in your VBScript code. S ub type Prefi