Lecture-18(variables)

Lecture-18(variables) - Data Types (Example) and VBA...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
Data Types (Example) and VBA Computations
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Const Statement You can declare constants at the start of a procedure. These are variables whose value you do not want to change during execution Syntax: Const constname (As type) = value Example Const pi As Double = 3.14159265358979 Const g As Double = 9.81, Avog As Double = 6.022E+23
Background image of page 2
Variable Scope Variable scope refers to passing of information within a module and between modules One way to pass information between modules and within procedures in a module is by specifying a parameter list Sub procedure Sub procedure Function procedure Sub procedure Function procedure Function procedure Module 1 Module 2
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Variable Scope This implies that you have to specify the data type for each variable in the program – default data types are not accepted This marks the beginning of the lifetime for the two variables x and y When a variable is passes as part of a parameter list, no new memory location is created. The same memory locations that have been allocated for x and y are accessed, albeit with temporary names a and b
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/27/2008 for the course PGE 310f taught by Professor Srinivasan during the Spring '08 term at University of Texas.

Page1 / 9

Lecture-18(variables) - Data Types (Example) and VBA...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online