Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



What is the scope of variable in Visual basic 6.0?

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 02-01-2011
Member
 
Join Date: Dec 2010
Posts: 8
What is the scope of variable in Visual basic 6.0?
  

Hey Guys, Can someone tell me what error handling in Visual basic 6.0 are? I don?t have a large amount acquaintance regarding Visual basic 6.0 but still I am not able get the perception of error handlings in visual basic. I am not able to find any link in it. But, I am not sure about it. I don?t have any clue regarding this topic. So, if anyone who has any knowledge or information about this than let know.

Reply With Quote
  #2  
Old 02-01-2011
Member
 
Join Date: May 2009
Posts: 532
Re: What is the scope of variable in Visual basic 6.0?

A variable is a name given to a memory location - the value of which can be changed during the execution of the program. DeclarationA variable can be declared in two ways viz. implicitly and explicitly. A. Implicit Declaration The variable in not declared by the programmer at all. It is directly used without any declaration. The data type of a variable declared implicitly is Variant. Implicit declaration can only be used if Option Explicit is not specified in the General Section. Explicit Declaration Syntax Dim Identifier [AsDatatype]Specification of the data type is optional.
Reply With Quote
  #3  
Old 02-01-2011
Member
 
Join Date: May 2009
Posts: 620
Re: What is the scope of variable in Visual basic 6.0?

If not specified, the variable's type defaults to Variant. Examples Dim X As Integer Dim Y Here, X is declared as an Integer. Y becomes a Variant as its data type is not specified. Multiple variables can be declared on the same line by separating them with commas. Example: Dim X As Integer, Y As Integer Note that when declaring multiple variables using single Dim statement, the data type must be specified for each variable. If you write as Dim X, Y, Z As Integer Then, X and Y become Variants and only Z becomes an Integer.
Reply With Quote
  #4  
Old 02-01-2011
Member
 
Join Date: May 2009
Posts: 523
Re: What is the scope of variable in Visual basic 6.0?

The scope of a variable is the section of the application that can see and manipulate the variable. The types of scope are as follows: Local If a variable is declared inside a procedure, it can only be accessed within that procedure. Such variables are said to be local variables. Module Level If a variable is declared in the Declaration Section of a form using the Dim or Private Statement, it can be accessed by any procedure of that form. Such variables are said to be Module Level variables. GlobalIf a variable is declared in the Declaration Section of a form using the Public statement, it can be accessed by any procedure in the entire project.
Reply With Quote
  #5  
Old 02-01-2011
Member
 
Join Date: Apr 2009
Posts: 484
Re: What is the scope of variable in Visual basic 6.0?

It is the period for which the variables retain their value. Public variables and Static variables exist for entire execution of the project. Module level variables declared in the Declaration Section of a form exist for the period for which the form is loaded. They are destroyed as soon as the form is unloaded. Local variables declared using the Dim statement are created each time the procedure is called and destroyed when the procedure ends.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "What is the scope of variable in Visual basic 6.0?"
Thread Thread Starter Forum Replies Last Post
Scope of Object or variable in Object oriented Programming Languages Dėfrim Software Development 3 08-01-2011 06:20 AM
Problem solving scope of variable Maya Angelou Software Development 5 23-03-2010 10:10 AM
How to use Variable scope in PHP? super soaker Software Development 4 21-02-2010 06:48 AM
Is GUI same like Visual Basic ? Caesar Software Development 2 02-03-2009 01:32 PM
Visual Basic 2005 or Visual Basic 6 Aasha Software Development 5 15-01-2009 06:56 PM


All times are GMT +5.5. The time now is 01:44 PM.