Exam coming up, I have questions I need help answering.

I have an upcoming exam and I don't have access to my professor and I have questions that the book is not clarifying for me.  The book that the class is using is Murach's Visual Basic 2008.

iI will list the questions will by numbers.  I understand that there are alot of questions here but I really need a good grade on this exam and these are the areas that I am still unsure of.  Some of the questions, I have tried to answer and I posted a comment in (), it my guess is correct could you annotate so.  If not could you help me get on base.

I am taking the exam tomorrow at 11.  I have been buried in this book for a couple of days now and I need help.  I am using this site as a last resort.  I figured individuals on here are much more proficient than myself so I mine as well ask the experts.  

I want to thank anyone in advance that is willing to answer any of these questions for me.  God Bless and Happy Veterans Day.  I myself am an "Iraq Veteran" in 2003.3. When and how to pass arguments by reference and by value?
       - The book says this.  I dont understand what it is saying at all:

Arguments are passed by value.  Because of that, the procedure can change the value of the parameter without affecting the value of he variable in the calling procedure.

In some cases, though, you will want to be able to change the value of the variable in the calling procedure from the called procedure.  To do that, you can pass the argument by reference.
When you call the procedure, a reference to that variable is passed to the procedure.  As a result, if that called procedure changes the value of the parameter, it also changes the value of the variable in the calling procure.  

If you pas a reference type by reference, you still cant change its value (the reference), but you can change the values of members of the object it refers to.  In contras if you pass a reference type by value, you can change both its value and the values of its members.

Can you explain this in laymen terms?
nosurf2dayAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dirk HaestProject managerCommented:
ByVal and ByRef: Passing Arguments in Visual Basic
http://visualbasic.about.com/od/learnvbnet/a/byvalbyref.htm

0
Dirk HaestProject managerCommented:
Byval is a way of passing parameters in by Value. This means that if you have 2 variables, a and b, and you pass them into a function with a=1 and b=2:

private sub function1(byval a as integer, byval b as integer)
a=50
b=60
end sub

Once you get out of this function, a will still be = 1, and b will still be = 2. If you were to use ByRef instead of byval... once you get out of the function a would b = 50 and b would be = 60.

Hope this helps.

By the way, passing parameters by reference is much more costly and time consuming than passing them by value.
0
Dirk HaestProject managerCommented:
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
nosurf2dayAuthor Commented:
Once again, you rock!  Thanks for all the help, I have 30 min before I take my exam and I am feeling much better.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.