Scope and lifetime of variables, Visual Basic Programming

Assignment Help:

The scope of a variable is finding out by where you declare it. While you declare a variable in a procedure, only code in that procedure can access or alter the value of that variable. It contain local scope and is called a procedure-level variable. If you declare a variable outside a process, you make it visible to all the process in your script. It is script-level variable, and it contain script-level scope.

How long a variable exists describe its lifetime. The lifetime of script-level variable extends from the time this is declared till the time the script is finished running. At process level, a variable exists only as long as you are in the process. While the procedure exits, the variable is destroyed. Local variables are ideal like temporary storage space while a process is executing. You can have local variables of the similar name in many different procedures because each is identified only by the process in which it is declared.


Related Discussions:- Scope and lifetime of variables

Shopping cart, Shopping Cart Purpose – Allows user to browse while keeping ...

Shopping Cart Purpose – Allows user to browse while keeping track of the items in which they will purchase at the end on the order page link and this will give a final price for al

Program to zoom a rectangle as you drag - visual c++, PROGRAM TO ZOOM A REC...

PROGRAM TO ZOOM A RECTANGLE AS YOU DRAG 1. Generate a SDI application 2. Declare the 2 member variables clicked of Boolean type and m_ptoldpt of CPoint type. Use the class t

Programming, steps of connecting database from vb6.0

steps of connecting database from vb6.0

Vb script coding conventions, Coding conventions are recommended that may h...

Coding conventions are recommended that may help you write code via Microsoft Visual Basic Scripting Edition. Coding conventions can include the given: Naming conventions for ob

Arrays, I need to design a logic for a program that allows a user to enter ...

I need to design a logic for a program that allows a user to enter 15 numbers, then displays each number and its difference from the numeric average of the numbers entered

Associating toolbars for the menu - visual basic, Associating Toolbars for ...

Associating Toolbars for the menu: 1. Insert the tool bar control to your form. 2. Now follow the steps to append the tool bar control to your form. 3. Then, Right Click

While loop - vbscript, In VBScript, the While...Wend statement is provided ...

In VBScript, the While...Wend statement is provided for those who are familiar along its usage. However, due to the lack of flexibility in While...Wend, it is suggested that you us

Mechanical project, sir , i need visual basic form design & coding for Reyn...

sir , i need visual basic form design & coding for Reynolds number & type of flow .

Sub and function procedures in code, In your code A, Function has to always...

In your code A, Function has to always be used on the right side of a variable assignment or in an expression. For illustration: Temp = Celsius(fDegrees) or Msg Box "The C

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd