|
-
Jun 3rd, 2005, 06:21 AM
#1
Thread Starter
Lively Member
basic question on parameters
Within a macro I call a function with the parameters a, b and c.
The definition of the function has parameters d, e and f.
In order to debug it, do I need to put a watch on a, b and c or on d, e and f?
-
Jun 3rd, 2005, 06:23 AM
#2
Re: basic question on parameters
 Originally Posted by pickarooney
Within a macro I call a function with the parameters a, b and c.
The definition of the function has parameters d, e and f.
In order to debug it, do I need to put a watch on a, b and c or on d, e and f?
What do you mean by "watch"?
What I normally do when debugging is to add MsgBox and then the variable to be checked at various points through the routing - that way you can tell any results that should not be there.
Can you elaborate on your porblem?
Cheers,
RyanJ
-
Jun 3rd, 2005, 06:28 AM
#3
Re: basic question on parameters
 Originally Posted by sciguyryan
What do you mean by "watch"?
From the IDE, click Debug/Add Watch
At least, that is the way it is in VB. I've no idea about Excel (and, because you use the term "macro", I'm assuming you are using Excel VBA not VB)
-
Jun 3rd, 2005, 10:38 AM
#4
Thread Starter
Lively Member
Re: basic question on parameters
Sorry, I should have specified it was a Word VBA macro. I assumed the IDE was the same. It seems I need to put watches on the d,e and f variables, going by the results I'm getting so far.
-
Jun 3rd, 2005, 11:02 AM
#5
Re: basic question on parameters
It all depends on what you actually want to watch and how the arguments (or parameters) are passed to your function, ByVal or ByRef. If they are passed ByVal the function can not change the origional variables values. Do you want to watch them while the function is running? In that case you need to watch the d, e, and f, but if you want to watch what has happen with the origional variables when the function has returned you must of course watch the a, b, and c variables.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|