Question:
I have 3 True/False Questions for anyone who understands Visual Basic?
?
2011-12-20 00:36:00 UTC
OOPS !! Okay, I guess I'll try this again ... Can somebody PLEASE help me with these 3 questions ?? I have been unsuccessfully trying to find the answers to them and I am ABSOLUTELY exhausted at this point !! Thank You for Looking & I hope your holiday season is peaceful and joyous !!

All The Best,
Eric

14. When you declare a variable below the class name of a Form, it will, by default, be defined for all the Event Procedures of that Form.
A) True
B) False

17. Global declarations of variables are placed below the class name of a Form.
A) True
B) False

18. When you declare a variable within an Event Procedure, it will be defined for all the Event Procedures of that Form.
A) True
B) False
Four answers:
Nace
2011-12-20 00:48:12 UTC
I am not so familiar with Visual Basic, but I know that in most programming languages that global variables go before code is written. In C global variables are placed just after the #include statements.
MT
2011-12-20 01:24:14 UTC
For 14, I'd say the answer is True. Variables declared within the scope of a class are visible to all Event Procedures in that class. They are, in fact, automatically initialized to that data type's default value (integer becomes 0, string becomes nothing etc...).



For 17, I wouldn't call class variables "Global variables", since they are only visible to the class or instances of the class. For global declaration, you do it outside the class, in the global namespace, which is "before the class name of a form" (assuming your class is not contained within another class). So, I'd say this one is False.



18 is simple. A variable declared in a procedure is visible to that procedure only, so this one is definitely False.



Hope this helps.
Teh Shet
2011-12-20 00:54:49 UTC
14. False

17. True

18. False



14. When you declare a variable but didn't define it, it won't be defined automatically and the IDE will notify you that this is an unused variable.



17. Yes, unless you put them under a public/private sub then it won't be global.



18. If you define it for a single event, it will be bound to that event only.



such as Private Sub Button1_Click() , that means that it's bound to Button 1 click only event.



I hope that's what you've been asking for.
bandley
2016-09-19 08:18:08 UTC
ummm... torrents are brilliant. I'm simply sayin... Try uninstalling your .NET framework, then putting in VB. No suggestion approximately the freezing, well success to ya. And fyi, if you are simply studying programming, pass forward and be trained VB, however do not restrict your self to it. Look at different languages and notice how the ideas you be trained with VB follow somewhere else.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...