Re: CORRECTED TEST AND ANSWERS.
- From: "Randy Birch" <rgb_removethis@xxxxxxxx>
- Date: Tue, 6 Dec 2005 22:26:24 -0500
: What is wrong with this code?
:
: Dim s as String
: s = "Test"
: MyFunction n
: ...
: Private Function MyFunction(byval nVar as integer) as integer
: <Do something fun>
: End Function
:
Actually you get variable not defined, as I suspect you meant to pass 's' as
the parameter, and not n which is now undeclared.
------------------
What is wrong with this code?
Private Sub MySub(byval nMat as integer) as long
---ANSWER
A Sub cannot have a return value.
A better (more accurate) answer is "A sub does not return a value".
-----------------
A form is Unloaded specifically set to Nothing while one control on it is
still referenced somewhere. What will happens?
---ANSWER
The form will be reloaded the instant that control is actively
referenced and will be loaded with default values instead of the
last values it contained.
To me you're missing the point with this question. Controls don't have
references per se; what you are saying is any reference to a control on the
form (execution of a control's property) will cause the reload. The question
would be better as: "A form has been Unloaded and set to Nothing. What will
happen if a property of one of that form's controls is now referenced in
code?" And the
------------------
Here's another one ...
What does n hold after executing this code?
n = DoEvents()
Answer: the number of currently open forms in the application.
--
Randy Birch
MS MVP Visual Basic
http://vbnet.mvps.org/
----------------------------------------------------------------------------
Read. Decide. Sign the petition to Microsoft.
http://classicvb.org/petition/
----------------------------------------------------------------------------
.
- Follow-Ups:
- Re: CORRECTED TEST AND ANSWERS.
- From: Richard Jalbert
- Re: CORRECTED TEST AND ANSWERS.
- References:
- Re: CORRECTED TEST AND ANSWERS.
- From: Richard Jalbert
- Re: CORRECTED TEST AND ANSWERS.
- Prev by Date: Re: CORRECTED TEST AND ANSWERS.
- Next by Date: Re: Transparent Listboxes
- Previous by thread: Re: CORRECTED TEST AND ANSWERS.
- Next by thread: Re: CORRECTED TEST AND ANSWERS.
- Index(es):
Relevant Pages
|