VB Chapter 7
False
The names of the arguments in a Call statement need to be identical to the names of the corresponding parameters. T or F?
True
The number of arguments listed in the Call statement's argumentList should agree with the number of parameters listed in the parameterList in the procedure header. T or F?
dblNewPrice = GetNewPrice(dblCurrentPrice)
The syntax ____ assigns a return value to a variable.
lblNewPrice.Text = GetNewPrice(dblCurrentPrice).ToString("C2")
The syntax ____ displays a return value.
Call procedureName([argumentList])
The syntax of the Call statement is ____.
variable
Usually, the statement that invokes a function will assign the function's return value to a(n) ____.
True
Visual Basic allows you to specify that an argument in the Call statement is optional. T or F
Pascal case
When using ____, you capitalize the first letter in the procedure name and the first letter of each subsequent word in the name.
by value
When you pass a variable ____, the computer passes only the contents of the variable to the receiving procedure.
Return dblNumber
Which of the following is a valid Return statement?
Private Function CalcSubtotal(ByVal decPrice As Decimal) As Decimal
Which of the following is a valid header for a procedure that is passed the number 9.75?
decTotal = decSubtotal + GetSalesTax(decSubtotal)
Which of the following statements will call the GetSalesTax function and return a value to be used in the Total calculation?
cboDepartment.Items.Count
Which of the following statements will determine the number of items in the list portion of the Department combo box?
Call DisplayMessage(strItemName, decItemPrice)
Which of the following statements would invoke the DisplayMessage Sub procedure?
intEnd = GetEndInventory(intBegInv, intItemsSold, intReturned)
Which of the following statements would invoke the GetEndInventory function and assign the function's return value to the intEnd variable?
False
You can determine whether a variable is being passed by value or by reference by looking at the Call statement. T or F?
Private Function GetEndInventory(ByVal intBegin As Integer, ByVal intSales As Integer, ByVal intReturns As Integer) As Integer
You need to create a function to calculate the ending inventory using three passed Integer variables: intBegin, intSales, and intReturns. Which of the following procedure headers should be used?
by value
You pass a variable ____ when the receiving procedure needs to know the variable's contents, but the receiving procedure does not need to change the contents.
Three
____ styles of combo boxes are available in Visual Basic.
Combo box
a control that allows the user to select from a list of choices and also has a text field that may or may not be editable
Independent Sub procedure
a procedure that is independent of any object and event; the procedure is processed only when called (invoked) from code
Function procedure
a procedure that returns a value after performing its assigned task
Cancel property
a property of the e parameter in the form's FormClosing event procedure; when set to True, it prevents the form from closing
Functions
another name for Function procedures
DropDownStyle property
determines the style of a combo box
FormClosing event
occurs when a form is about to be closed, which can happen as a result of the computer processing the Me.Close() statement or the user clicking the Close button on the form's title bar|
False
A Function procedure does not return a value after performing its assigned task. T or F?
combo box
A ____ is similar to a list box in that it allows the user to select from a list of choices.
FormClosing event
A form's ____ procedure is responsible for verifying that the user wants to close the application, and then taking the appropriate action based on the user's response.
independent Sub procedure
A(n) ____ is processed only when it is called (invoked) from code.
Return statement
the Visual Basic statement that returns a function's value to the statement that invoked the function
Call statement
the Visual Basic statement used to invoke (call) an independent Sub procedure
Passing by value
the process of passing a copy of a variable's value to a procedure
Passing by reference
the process of passing a variable's address to a procedure so that the value in the variable can be changed
Math.Round function
used to round a number to a specific number of decimal places
False
An event procedure is a Function procedure that is associated with a specific object and event. T or F?
Parameters
An independent Sub procedure can contain one or more ____ in its procedure header that have procedure scope and store an item of data.
True
An independent Sub procedure is a procedure that is independent of any object and event. T or F?
Add
As you do with list boxes, you use the Items collection's ____ method to add an item to a combo box.
One less than
For the access key to work correctly in a combo box, you must set the label's TabIndex property to a value that is ____ the combo box's TabIndex value
integer
If the digits argument is omitted, the Math.Round function returns a(n) ____.
DropDownList
In a ____ combo box, the text portion is not editable.
False
Like a Sub procedure header, a Function procedure header includes the As dataType section. T or F?
0
Like the first item in a list box, the first item in a combo box has an index of ____.
False
Math.Round(3.234, 2) returns the number 3.24. T or F?
As
The ____ keyword in a function header identifies the data type of the data being returned.
True
The computer automatically processes an event procedure when the event occurs. T or F?
DropDown
The default combo box style in Visual Basic is ____.
287.88
The expression Math.Round(287.876, 2) yields a value of ____.