1/49
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Controls and variables
temporarily store data
Variable
Temporary storage location in main memory. Specified by data type, name, scope, and lifetime
Data type
Specifies type of data a variable can store. Provides a class template for creating variables
Unicode
Universal coding scheme for characters. Assigns unique numeric value to each character in the written languages of the world
Name
Variables are referred to by ____
Identifier
Another term for variable name
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
Declaration statement
Used to declare (create) a variable and reserve space in memory for it
0
default value of declared numeric variable without value
False
default value of declared boolean variable without value
Nothing
default value of declared Object and String variable without value
1/1/0001 12:00:00 AM
default value of declared date variable without value
Assignment statement
Assigns value to variable at run time. Expression may include literal constants, object properties, variables, keywords, arithmetic operators
Literal constant
Data item whose value does not change
Literal type character
Forces literal constant to change data type
TryParse method
Converts string to number. Is preferred over Val as it Allows programmer to specify data type
Double
Val only returns a type ______ value
Convert class
Can be used to convert a number from one type to another
TryParse
is recommended for converting strings to numeric data types. Will not produce an error if conversion fails
Scope
Indicates where variable can be used
Lifetime
How long variable remains in memory.
Class, procedure, block
3 types of scope
Class
type of scope. Variable can be used by all procedures in a form
Procedure
type of scope. Variable can be used within _________
Block
type of scope. Variable can be used within specific code _____
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
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
Static variable
Procedure-level variable with extended lifetime. Remains in memory between procedure calls. Retains its value even when the procedure ends
Static keyword
Used to declare static variable. Act like class-level variables but have narrower scope. Can only be used within procedure where declared
Named constant
Memory location inside computer whose contents cannot be changed at run time
Const statement
Creates named constant. Stores value of expression in named constant
Expression
Can be literal constant, another named constant, or an arithmetic operator
Option Explicit On
a statement that Prevents you from using undeclared variables
Implicit type conversion
Converts right-side value to the data type of left side
Promotion
Data converted to greater precision number, e.g., Integer to Decimal
Demotion
Data truncated e.g., Decimal to Integer. Data loss can occur when it occurs
Option Infer Off
a statement that Ensures that every variable is declared with a data type
Option Strict On
a statement that Disallows implicit conversions. Type conversion rules are applied when this option is on
Concatenate
Connect strings together
Ampersand
Concatenation operator symbol
Strings
numeric values used with the & operator are converted to _______
InputBox function
Displays dialog box and retrieves user input
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
_
Line continuation character
Line continuation character
(_) Used to break up long line of code into two or more lines
Default button
Button that is activated by pressing Enter key. Button is not required to have the focus. Only one per form
Formatting
Specifying decimal places and special characters to display
ToString method
is replacing Format function
Syntax:
variablename.ToString(formatString)
variablename: Name of a numeric variable
formatString: String specifying format you want to use
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
Handles
_______ clause. Appears in an event procedure's header. Indicates object and event associated with procedure