Deck 8: Sub and Function Procedures

Full screen (f)
exit full mode
Question
All event procedures contain the ____ parameters in their procedure header.

A) thrower and f
B) e and system
C) sender and e
D) title and e
Use Space or
up arrow
down arrow
to flip the card.
Question
The rules for naming an independent Sub procedure are the same as those for naming variables.
Question
In most cases, the procedure header begins with the ____ keyword.

A) Public
B) Private
C) Sub
D) Call
Question
You cannot pass information to a function by reference.
Question
You pass a variable by ____ when you want the receiving procedure to change the contents of the variable.

A) value
B) memory
C) name
D) reference
Question
A(n) ____ Sub procedure is processed only when called (invoked) from code.

A) independent
B) event
C) parameterized
D) modular
Question
Procedure names are usually entered using ____.

A) Top case
B) Worm case
C) Pascal case
D) Hill case
Question
The ____ keyword tells the computer to pass the variable's address rather than a copy of its contents.

A) ByName
B) ByMem
C) ByRef
D) ByVal
Question
The procedure footer for a Sub procedure is always ____.

A) Private Sub
B) End Case
C) Exit Sub
D) End Sub
Question
After creating your own function in Visual Basic, you can invoke it from one or more places in an application's code.
Question
The ____ parameter in an event procedure's header contains additional information provided by the object that raised the event.

A) sender
B) e
C) event
D) click
Question
When you pass a variable by value, the receiving procedure can change the value stored inside the variable.
Question
The ____ parameter of an event procedure contains the memory address of the object that raised the event.

A) sender
B) e
C) event
D) click
Question
To pass a variable by value, you include the keyword ____ before the name of its corresponding parameter in the procedure's parameterList.

A) ByRef
B) ByVal
C) ByValue
D) ByName
Question
You can invoke an independent Sub procedure using the ____ statement.

A) Event
B) Parameter
C) Method
D) Call
Question
The number of arguments in the Call statement's argumentList should agree with the number of parameters in the procedure's parameterList.
Question
The ____ clause in an event procedure's header indicates the object and event associated with the procedure.

A) Call
B) ByVal
C) ByRef
D) Handles
Question
The ____ parameter in the KeyPress event procedure's header contains a character that corresponds to the key pressed by the user.

A) sender
B) e
C) Handles
D) As
Question
Passing a variable's address to the receiving procedure is referred to as passing by ____.

A) address
B) parameter
C) reference
D) value
Question
The parameterList lists the data type and name of one or more memory locations, called ____.

A) functions
B) parameters
C) clauses
D) constants
Question
Match each item with a statement below.
a.Return statement
f.parameter
b.address
g.event procedure
c.Call statement
h.As datatype clause
d.independent Sub procedure
i.Sub procedure
e.Function procedure
Returns a value after performing its assigned task
Question
To pass a variable by reference in Visual Basic, you include the keyword ____________________ before the variable's corresponding parameter in the receiving procedure's header.
Question
Match each item with a statement below.
a.Return statement
f.parameter
b.address
g.event procedure
c.Call statement
h.As datatype clause
d.independent Sub procedure
i.Sub procedure
e.Function procedure
Allows the programmer to avoid duplicating code in different sections of a program
Question
Associating a procedure with more than one object and event allows the programmer to avoid ____________________ code in different parts of the program..
Question
Match each item with a statement below.
a.Return statement
f.parameter
b.address
g.event procedure
c.Call statement
h.As datatype clause
d.independent Sub procedure
i.Sub procedure
e.Function procedure
Stores information passed to a procedure when it is invoked
Question
Match each item with a statement below.
a.Return statement
f.parameter
b.address
g.event procedure
c.Call statement
h.As datatype clause
d.independent Sub procedure
i.Sub procedure
e.Function procedure
Location in the computer's internal memory
Question
A(n) ____ occurs each time an interval has elapsed.

A) Interval event
B) Tick Event
C) Click event
D) Timer event
Question
Match each item with a statement below.
a.Return statement
f.parameter
b.address
g.event procedure
c.Call statement
h.As datatype clause
d.independent Sub procedure
i.Sub procedure
e.Function procedure
The last statement within a function
Question
The function's header and footer contain the ____ keyword.

A) Sub
B) Funct
C) Return
D) Function
Question
Match each item with a statement below.
a.Return statement
f.parameter
b.address
g.event procedure
c.Call statement
h.As datatype clause
d.independent Sub procedure
i.Sub procedure
e.Function procedure
Used to specify the data type of the value returned by the function
Question
Unlike a Sub procedure header, a function's header includes the ____ section.

A) Handles
B) ByVal
C) As datatype
D) ByRef
Question
The process of converting a variable from one data type to another is referred to as ____.

A) casting
B) changing
C) transferring
D) translating
Question
The last statement in a function is typically the ____________________.
Question
Procedure names are usually entered using ____________________ case.
Question
The Return statement's syntax is ____ expression, where expression represents the one and only value that will be returned to the statement invoking the function.

A) Return
B) Send
C) Handles
D) As
Question
When you pass a variable ____________________, the computer passes a copy of the variable's contents to the receiving procedure.
Question
Match each item with a statement below.
a.Return statement
f.parameter
b.address
g.event procedure
c.Call statement
h.As datatype clause
d.independent Sub procedure
i.Sub procedure
e.Function procedure
Used to invoke an independent Sub procedure
Question
A(n) ____ procedure returns a value after performing its assigned task.

A) Argument
B) Function
C) Parameter
D) Event
Question
Match each item with a statement below.
a.Return statement
f.parameter
b.address
g.event procedure
c.Call statement
h.As datatype clause
d.independent Sub procedure
i.Sub procedure
e.Function procedure
Does not return a value after performing its assigned task
Question
Match each item with a statement below.
a.Return statement
f.parameter
b.address
g.event procedure
c.Call statement
h.As datatype clause
d.independent Sub procedure
i.Sub procedure
e.Function procedure
A Sub procedure that is associated with a specific object and event
Question
What is the difference between Sub procedures and Function procedures?
Question
What is the purpose of a timer control?
Question
What are two reasons for using independent Sub procedures in code?
Question
What is an event procedure?
Question
What are the rules for naming an independent Sub procedure?
Question
What is an independent Sub procedure?
Question
How do you invoke a function that you have created?
Question
How do you view the properties of an event procedure's e parameter?
Question
On what basis should you decide whether you should pass a variable's value or address to the receiving procedure?
Question
What kind of access to a variable does the receiving procedure have when the variable is passed to it by value?
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/50
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 8: Sub and Function Procedures
1
All event procedures contain the ____ parameters in their procedure header.

A) thrower and f
B) e and system
C) sender and e
D) title and e
C
2
The rules for naming an independent Sub procedure are the same as those for naming variables.
True
3
In most cases, the procedure header begins with the ____ keyword.

A) Public
B) Private
C) Sub
D) Call
B
4
You cannot pass information to a function by reference.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
5
You pass a variable by ____ when you want the receiving procedure to change the contents of the variable.

A) value
B) memory
C) name
D) reference
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
6
A(n) ____ Sub procedure is processed only when called (invoked) from code.

A) independent
B) event
C) parameterized
D) modular
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
7
Procedure names are usually entered using ____.

A) Top case
B) Worm case
C) Pascal case
D) Hill case
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
8
The ____ keyword tells the computer to pass the variable's address rather than a copy of its contents.

A) ByName
B) ByMem
C) ByRef
D) ByVal
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
9
The procedure footer for a Sub procedure is always ____.

A) Private Sub
B) End Case
C) Exit Sub
D) End Sub
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
10
After creating your own function in Visual Basic, you can invoke it from one or more places in an application's code.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
11
The ____ parameter in an event procedure's header contains additional information provided by the object that raised the event.

A) sender
B) e
C) event
D) click
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
12
When you pass a variable by value, the receiving procedure can change the value stored inside the variable.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
13
The ____ parameter of an event procedure contains the memory address of the object that raised the event.

A) sender
B) e
C) event
D) click
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
14
To pass a variable by value, you include the keyword ____ before the name of its corresponding parameter in the procedure's parameterList.

A) ByRef
B) ByVal
C) ByValue
D) ByName
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
15
You can invoke an independent Sub procedure using the ____ statement.

A) Event
B) Parameter
C) Method
D) Call
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
16
The number of arguments in the Call statement's argumentList should agree with the number of parameters in the procedure's parameterList.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
17
The ____ clause in an event procedure's header indicates the object and event associated with the procedure.

A) Call
B) ByVal
C) ByRef
D) Handles
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
18
The ____ parameter in the KeyPress event procedure's header contains a character that corresponds to the key pressed by the user.

A) sender
B) e
C) Handles
D) As
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
19
Passing a variable's address to the receiving procedure is referred to as passing by ____.

A) address
B) parameter
C) reference
D) value
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
20
The parameterList lists the data type and name of one or more memory locations, called ____.

A) functions
B) parameters
C) clauses
D) constants
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
21
Match each item with a statement below.
a.Return statement
f.parameter
b.address
g.event procedure
c.Call statement
h.As datatype clause
d.independent Sub procedure
i.Sub procedure
e.Function procedure
Returns a value after performing its assigned task
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
22
To pass a variable by reference in Visual Basic, you include the keyword ____________________ before the variable's corresponding parameter in the receiving procedure's header.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
23
Match each item with a statement below.
a.Return statement
f.parameter
b.address
g.event procedure
c.Call statement
h.As datatype clause
d.independent Sub procedure
i.Sub procedure
e.Function procedure
Allows the programmer to avoid duplicating code in different sections of a program
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
24
Associating a procedure with more than one object and event allows the programmer to avoid ____________________ code in different parts of the program..
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
25
Match each item with a statement below.
a.Return statement
f.parameter
b.address
g.event procedure
c.Call statement
h.As datatype clause
d.independent Sub procedure
i.Sub procedure
e.Function procedure
Stores information passed to a procedure when it is invoked
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
26
Match each item with a statement below.
a.Return statement
f.parameter
b.address
g.event procedure
c.Call statement
h.As datatype clause
d.independent Sub procedure
i.Sub procedure
e.Function procedure
Location in the computer's internal memory
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
27
A(n) ____ occurs each time an interval has elapsed.

A) Interval event
B) Tick Event
C) Click event
D) Timer event
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
28
Match each item with a statement below.
a.Return statement
f.parameter
b.address
g.event procedure
c.Call statement
h.As datatype clause
d.independent Sub procedure
i.Sub procedure
e.Function procedure
The last statement within a function
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
29
The function's header and footer contain the ____ keyword.

A) Sub
B) Funct
C) Return
D) Function
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
30
Match each item with a statement below.
a.Return statement
f.parameter
b.address
g.event procedure
c.Call statement
h.As datatype clause
d.independent Sub procedure
i.Sub procedure
e.Function procedure
Used to specify the data type of the value returned by the function
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
31
Unlike a Sub procedure header, a function's header includes the ____ section.

A) Handles
B) ByVal
C) As datatype
D) ByRef
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
32
The process of converting a variable from one data type to another is referred to as ____.

A) casting
B) changing
C) transferring
D) translating
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
33
The last statement in a function is typically the ____________________.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
34
Procedure names are usually entered using ____________________ case.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
35
The Return statement's syntax is ____ expression, where expression represents the one and only value that will be returned to the statement invoking the function.

A) Return
B) Send
C) Handles
D) As
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
36
When you pass a variable ____________________, the computer passes a copy of the variable's contents to the receiving procedure.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
37
Match each item with a statement below.
a.Return statement
f.parameter
b.address
g.event procedure
c.Call statement
h.As datatype clause
d.independent Sub procedure
i.Sub procedure
e.Function procedure
Used to invoke an independent Sub procedure
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
38
A(n) ____ procedure returns a value after performing its assigned task.

A) Argument
B) Function
C) Parameter
D) Event
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
39
Match each item with a statement below.
a.Return statement
f.parameter
b.address
g.event procedure
c.Call statement
h.As datatype clause
d.independent Sub procedure
i.Sub procedure
e.Function procedure
Does not return a value after performing its assigned task
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
40
Match each item with a statement below.
a.Return statement
f.parameter
b.address
g.event procedure
c.Call statement
h.As datatype clause
d.independent Sub procedure
i.Sub procedure
e.Function procedure
A Sub procedure that is associated with a specific object and event
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
41
What is the difference between Sub procedures and Function procedures?
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
42
What is the purpose of a timer control?
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
43
What are two reasons for using independent Sub procedures in code?
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
44
What is an event procedure?
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
45
What are the rules for naming an independent Sub procedure?
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
46
What is an independent Sub procedure?
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
47
How do you invoke a function that you have created?
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
48
How do you view the properties of an event procedure's e parameter?
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
49
On what basis should you decide whether you should pass a variable's value or address to the receiving procedure?
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
50
What kind of access to a variable does the receiving procedure have when the variable is passed to it by value?
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 50 flashcards in this deck.