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
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

How to Include List Box control in your project A list box is used for representing the users with a data. You can prefer the data from the list box for data entry. No editing

MESSAGE LOOP   The message loop is the code in the Win 32 based application. It retrieves messages from the application's message queue and passes these to the related window

The following table lists suggested conventions for objects you might encounter while programming VBScript. Code Commenting Conventions All process should begin with a brie

Aim: To exhibit what is the day when the second command button is clicked and to clear the screen when the first command button is clicked. The functioning of this program is

Goal Create a Visual Basic that allows a user to play a variation of Hangman. User Inputs • The user types a letter into the textbox. Functional Items 1. Read a series

Depreciation to a Salvage Value of 0.   For tax purposes an item may be depreciated over a period of several years, n. With the straight-line method of depreciation, each year th

The Document: The document contains the user's data. For illustration, after working on a text processor, the user may wish for to save the file. Such an action builds a docum

#questiontypes of lines and how to draw

You are given a console program in both VB and C# that uses a class CElevator (ElevatorAppAssign). The main modules are in the assign directory class files. Below is a discus