CHAPTER 3 - Using Variables and Constants

0.0(0)
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/49

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

50 Terms

1
New cards

Controls and variables

temporarily store data

2
New cards

Variable

Temporary storage location in main memory. Specified by data type, name, scope, and lifetime

3
New cards

Data type

Specifies type of data a variable can store. Provides a class template for creating variables

4
New cards

Unicode

Universal coding scheme for characters. Assigns unique numeric value to each character in the written languages of the world

5
New cards

Name

Variables are referred to by ____

6
New cards

Identifier

Another term for variable name

7
New cards

Hungarian notation

Use_________ ________, with a three-character prefix representing the variable's data type. Name should be descriptive: e.g., dblLength. Use camel case: e.g., dblSalesAmount

8
New cards

Declaration statement

Used to declare (create) a variable and reserve space in memory for it

9
New cards

0

default value of declared numeric variable without value

10
New cards

False

default value of declared boolean variable without value

11
New cards

Nothing

default value of declared Object and String variable without value

12
New cards

1/1/0001 12:00:00 AM

default value of declared date variable without value

13
New cards

Assignment statement

Assigns value to variable at run time. Expression may include literal constants, object properties, variables, keywords, arithmetic operators

14
New cards

Literal constant

Data item whose value does not change

15
New cards

Literal type character

Forces literal constant to change data type

16
New cards

TryParse method

Converts string to number. Is preferred over Val as it Allows programmer to specify data type

17
New cards

Double

Val only returns a type ______ value

18
New cards

Convert class

Can be used to convert a number from one type to another

19
New cards

TryParse

is recommended for converting strings to numeric data types. Will not produce an error if conversion fails

20
New cards

Scope

Indicates where variable can be used

21
New cards

Lifetime

How long variable remains in memory.

22
New cards

Class, procedure, block

3 types of scope

23
New cards

Class

type of scope. Variable can be used by all procedures in a form

24
New cards

Procedure

type of scope. Variable can be used within _________

25
New cards

Block

type of scope. Variable can be used within specific code _____

26
New cards

Procedure, Dim

Variables with _________ scope Can be used only by that procedure. Declared at beginning of procedure. Removed from memory when procedure ends. Declared using Dim keyword

27
New cards

class , Private

Variables with _____ scope. Can be used by all procedures in a form. Declared in form's Declarations section. Remain in memory until application ends Declared using _______ keyword

28
New cards

Static variable

Procedure-level variable with extended lifetime. Remains in memory between procedure calls. Retains its value even when the procedure ends

29
New cards

Static keyword

Used to declare static variable. Act like class-level variables but have narrower scope. Can only be used within procedure where declared

30
New cards

Named constant

Memory location inside computer whose contents cannot be changed at run time

31
New cards

Const statement

Creates named constant. Stores value of expression in named constant

32
New cards

Expression

Can be literal constant, another named constant, or an arithmetic operator

33
New cards

Option Explicit On

a statement that Prevents you from using undeclared variables

34
New cards

Implicit type conversion

Converts right-side value to the data type of left side

35
New cards

Promotion

Data converted to greater precision number, e.g., Integer to Decimal

36
New cards

Demotion

Data truncated e.g., Decimal to Integer. Data loss can occur when it occurs

37
New cards

Option Infer Off

a statement that Ensures that every variable is declared with a data type

38
New cards

Option Strict On

a statement that Disallows implicit conversions. Type conversion rules are applied when this option is on

39
New cards

Concatenate

Connect strings together

40
New cards

Ampersand

Concatenation operator symbol

41
New cards

Strings

numeric values used with the & operator are converted to _______

42
New cards

InputBox function

Displays dialog box and retrieves user input

43
New cards

ControlChars.NewLine

a constant command. Advances the insertion point to the next line in a control. Also used to advance insertion point in file or on printer

44
New cards

_

Line continuation character

45
New cards

Line continuation character

(_) Used to break up long line of code into two or more lines

46
New cards

Default button

Button that is activated by pressing Enter key. Button is not required to have the focus. Only one per form

47
New cards

Formatting

Specifying decimal places and special characters to display

48
New cards

ToString method

is replacing Format function

Syntax:

variablename.ToString(formatString)

variablename: Name of a numeric variable

formatString: String specifying format you want to use

49
New cards

TextChanged event

Occurs when the Text property value of a control change. Can occur when The user enters data into the control or Code assigns data to the control's Text property

50
New cards

Handles

_______ clause. Appears in an event procedure's header. Indicates object and event associated with procedure