Wednesday, April 13, 2011

VARIABLE, VAL and constants in visual basic

| Wednesday, April 13, 2011 | 0 comments

VARIABLE, VAL and constants

VARIABLE

The variable is a place in memory that is named (as an identifier) and allocated to accommodate the data.
Syntax: As Type Dim name of the variable data
Example: Dim a As Integer
Dim name As String



Naming rules of variables in Visual Basic is:
1. No more than 40 characters
2. Consisting of letters, numbers and underscore (_)
3. The first character must be a letter
4. May not use words that are defined by visual basic (reserved word)

How to put variable to the source code:
a) In General
If the variable is placed on the General then these variables can be read on eachprocedure in a Form.
b) In Procedure
If the variable is placed on the procedure in each object, then the variable can only be read on the procedure alone (no other procedure can be read at even the one from).
c) In Module
If the variable is placed in Module then these variables can be read or be called onevery procedure in a single project.
VAL
Val or value is used if we do not declare a variable, or to convert or change the datatype string to type numeric data.

Constant
Constants together with the variables but constants have fixed values ​​or characterconstant. Declare the constants in Visual Basic using the Const [a constant] As [data type of the constant] = [value constants].
Example of declaring a constant:
Const Phi As Integer = 3:14



completed




thank you for visiting my blog

0 comments:

:)) ;)) ;;) :D ;) :p :(( :) :( :X =(( :-o :-/ :-* :| 8-} :)] ~x( :-t b-( :-L x( =))

Post a Comment

thank you for visiting my blog and comment here. I hope the commentary contains a comment which intend to build and repair. criticism and suggestions I gladly accept.

Popular Posts

 

Total Pageviews

stat

© Copyright 2010. http://programminghaha.blogspot.com . All rights reserved | http://programminghaha.blogspot.com is proudly powered by Blogger.com | Template by o-om.com - zoomtemplate.com