Accessing Variables in your project

Slides:



Advertisements
Similar presentations
Operators & Identifiers The Data Elements. Arithmetic Operators exponentiation multiplication division ( real ) division ( integer quotient ) division.
Advertisements

Chapter 8 Scope, Lifetime and More on Functions. Definitions Scope –The region of program code where it is legal to reference (use) an identifier Three.
Local Variables and Scope Benjamin Fein. Variable Scope A variable’s scope consists of all code blocks in which it is visible. A variable is considered.
Summary of the lecture We discussed –variable scope –instance variable declarations –variable lifetime.
Subroutines sub { –#parameters are placed – –. –return; }
1 Pertemuan 07 Procedures Matakuliah: D0524 / Algoritma dan Pemrograman Komputer Tahun: 2005 Versi:
Introduction to Active Server Pages
Fortran 9x HTML version. New F90 features Free source form Modules User-defined data types and operators Generic user-defined procedures Interface blocks.
Chapter 41 Sub Procedures, Part II (Continue). Chapter 42 Local Variable A variable declared inside a Sub procedure with a Dim statement Space reserved.
Promoting Code Reuse Often in programming, multiple procedures will perform the same operation IN OTHER WORDS – the same piece of code will do the same.
Scope of Variables and Constants A Variable or Constant may exist and be Visible for an entire project, for only one form, or for only one procedure Therefore,
VB – Core III Functions Sub-routines Parameter passing Modules Scope Lifetime.
Chapter 6: Function. Scope of Variable A scope is a region of the program and broadly speaking there are three places, where variables can be declared:
Introduction to Class Modules Please use speaker notes for additional information!
Variable, Expressions, Statements and Operators By: Engr. Faisal ur Rehman CE-105 Fall 2007.
Prof. Alfred J Bird, Ph.D., NBCT Office – McCormack 3rd floor 607.
Procedures and Functions Computing Module 1. What is modular programming? Most programs written for companies will have thousands of lines of code. Most.
Arrays and 2D Arrays.  A Variable Array stores a set of variables that each have the same name and are all of the same type.  Member/Element – variable.
Introduction to VB.NET 2005 Dr. McDaniel IDS4704 Spring 2005.
CS285 Visual Basic 2 Department of Computing UniS 1 Statements in Visual Basic A statement is the fundamental syntactical element of a program smallest.
IFS310: Module 4 11/3/2015 Structured Methodology and COBOL.
Illustration of a Visual Basic Program Running an Ada Program 1 by Richard Conn 11 September 1999.
Overview of VBA Programming & Syntax. Programming With Objects u Objects –Properties: attributes or characteristics of an object (e.g., font size, color,
I Power Higher Computing Software Development High Level Language Constructs.
Practical Programming COMP153-08S Week 5 Lecture 1: Screen Design Subroutines and Functions.
CNS 1120 Exam 1 Review. Programming Language Elements Syntax = the rules to follow Syntax = the rules to follow Semantics = the meaning of symbols Semantics.
CS0007: Introduction to Computer Programming Classes: Documentation, Method Overloading, Scope, Packages, and “Finding the Classes”
Chapter 3 w Variables, constants, and calculations DIM statements - declaration temporary memory locations identifier, data type, scope data types - values.
Arrays and others. Annoucement Today’s office hour move to Friday 1:00PM to 3:00PM Today’s office hour move to Friday 1:00PM to 3:00PM Today Today  Call.
Understanding Visual Basic Fundamentals CHAPTER 13 Understanding Visual Basic Fundamentals.
Controlling Program Flow with Decision Structures.
Department of Electronic & Electrical Engineering Functions Parameters Arguments Pointers/dereference & * Scope Global/Local Storage Static/Automatic.
More on Variables and Subroutines. Introduction Discussion so far has dealt with self- contained subs. Subs can call other subs or functions. A module.
CSC 162 Visual Basic I Programming. Storage Classes Determines the “lifetime” of an identifier Types: –Automatic Default Memory is allocated for the variable.
CIS 338: VB Variables Dr. Ralph D. Westfall April, 2011.
More Visual Basic Code: if-then-else, for loops Controls: Multiple forms, List Boxes, Radio buttons, frames,
Control Structure  What is control Structure?  Types of Controls  Use the control structure in VBScript.  Example Summery.
Excel Functions. Part 1. Introduction 2 An Excel function is a formula or a procedure that is performed in the Visual Basic environment, outside the.
Programming Right from the Start with Visual Basic .NET 1/e
Section 2.1: Programming paradigms
UNIT 5 Lesson 15 Looping.
Classes & Objects There are two main programming paradigms: Procedural Object-Oriented Up to now, everything we have done has been procedural.
Programming constructs
John Levesque Director Cray Supercomputing Center of Excellence
Visual Basic 6 (VB6) Data Types, And Operators
SHARED MEMORY PROGRAMMING WITH OpenMP
Problem Solving and Control Statements: Part 2
Character (String) Data
Section 2.1: Programming paradigms
Lecture Set 4 Data Types and Variables
VISUAL BASIC.
مبررات إدخال الحاسوب في رياض الأطفال
21twelveinteractive.com/ twitter.com/21twelveI/ facebook.com/21twelveinteractive/ linkedin.com/company/21twelve-interactive/ pinterest.com/21twelveinteractive/
Tonga Institute of Higher Education
Controls, Properties, and Procedures
Language Constructs Construct means to build or put together. Language constructs refers to those parts which make up a high level programming language.
Procedures: Functions and Subroutines
The structure of programming
Chapter 8 - Functions and Functionality
Scope J. Michael Moore.
Classes & Objects A deeper Look Chapter 10 & 11
Where is all the knowledge we lost with information? T. S. Eliot
For...Next Statements.
Chapter (3) - Procedures
Brent M. Dingle Texas A&M University Chapter 5 – Section 1
CPS125.

Programming in C# CHAPTER - 9
Methods Scope How are names handled?
Presentation transcript:

Accessing Variables in your project Scope Accessing Variables in your project

Block Level If you dimension your variable in a block of code such as if/then, for/next, or select/case, that variable disappears from memory when the block is done

Procedure Level If you dimension your variable within a subroutine or function, that variable disappears from memory when the procedure is done

Module Level A module is a large block of code identified as a module. Normally it is it’s own file—but not necessarily. If you dimension your variable in a module, but outside of any subroutine or function, that variable disappears from memory when the module is done. …Unless you dimension it Publicly: Public intMyVariable As Integer Module level variables are good in all blocks and procedures of the Module

Procedure Scope You create your subroutines as Public if you wish to share them between code modules Or private if only that module can use it Private Function myFunction()

Namespace Level Relevant to large projects that may consist of several VB projects that interact.