Chapter 3 w Variables, constants, and calculations DIM statements - declaration temporary memory...

4
Chapter 3 Variables, constants, and calculations DIM statements - declaration temporary memory locations identifier, data type, scope data types - values string, integer, currency naming rules - conventions

Transcript of Chapter 3 w Variables, constants, and calculations DIM statements - declaration temporary memory...

Page 1: Chapter 3 w Variables, constants, and calculations DIM statements - declaration temporary memory locations identifier, data type, scope data types - values.

Chapter 3

Variables, constants, and calculations• DIM statements - declaration• temporary memory locations• identifier, data type, scope• data types - values

• string, integer, currency

• naming rules - conventions

Page 2: Chapter 3 w Variables, constants, and calculations DIM statements - declaration temporary memory locations identifier, data type, scope data types - values.

• Constants • named - define with CONST - name, data type, and

value– numbers or strings

• intrinsic - VB built in– vbRed - predefined

• declaring variables• scope of variables - lifetime

• global - all procedures

• module - all procedures in form

• local - within procedure

Calculations - numbers only• change text to number - VAL function

Page 3: Chapter 3 w Variables, constants, and calculations DIM statements - declaration temporary memory locations identifier, data type, scope data types - values.

Arithmetic operations• order of operations, precedence• * / before + -• parentheses alter order

Formatting data - look• formatting function• values not used in calculations

Counting and Accumulating Sums• module-level variable

option explicit - forced to declare variables

Page 4: Chapter 3 w Variables, constants, and calculations DIM statements - declaration temporary memory locations identifier, data type, scope data types - values.

#6 - P.E. 3.2 – pg. 119 design (name everything), print code, form, form as text, general and module comments, print one example of output; declare every variable (option explicit); val function for input text boxes; constant for the 10% fee – use in formula; format output correctly

#7 - pg. 163 - review questions 1-15