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
Part 1: Create an application that allows the user to enter the following employee data: First Name, Middle Name, Last Name, Employee Number, Department, Telephone Number, Telephon

INTRODUCTION TO GUI DESIGN AND FILE HANDLING   The aim of the user interface design is to attain the user's goals. When the user's goals are met, the user is satisfied and the

A constant is a meaningful name which takes the place of a number or string and never alters. VBScript described a number of intrinsic constants. You can get thorough information r

i want to use two forms in vb.net. when the progress bar in form1 reaches on a specific value then disable form1 and progress bar will stop and the second Form2 will popup which wi

ILLUSTRATION OF CCOLORDIALOG The constructor of the CColorDialog takes the initial parameter as the default color and the next parameter specifies how much the dialog is displa

Develop a web page that is used for accepting information regarding stocks. Make sure the form carry out the possible validations. The simple instance code below merely illustrates

Associating Images to Toolbars: 1. Add an Image list to your form from the tool box. 2. Pick the custom property of the image list. 3. Click the images tab. 4. Select

FILES IN A VB PROJECT The project file has the.vbp extension. The form in which we draw has the .frm extension; .mod denotes the module file; .cls denotes the class file; .res

DDX - Dialog Data Exchange: The Data members can be related with specific controls in the dialog box. When the dialog box is displayed, the DDX will transfer the values into t

STEPS TO CREATE A RECTANGLE IN THE CLIENT REGION 1. Generate a SDI application and name it as a brush. 2. Handle the WM_LBUTTONDOWN message for the CBrushView object id.