Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Excel 2007 VBA Programmer's Reference ISBN: 978-0-470-04643-2
This is the forum to discuss the Wrox book Excel 2007 VBA Programmer's Reference by John Green, Stephen Bullen, Rob Bovey, Michael Alexander; ISBN: 9780470046432
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Excel 2007 VBA Programmer's Reference ISBN: 978-0-470-04643-2 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old October 8th, 2011, 09:53 AM
Registered User
Points: 12, Level: 1
Points: 12, Level: 1 Points: 12, Level: 1 Points: 12, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2011
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Default Terminology

Hi there,

I´m a newbie (at the forum and at VBA), so here goes a, perhaps, silly question.

What's the difference between an "argument" and a "parameter", if any?

It seems to me the authors use both words as synonyms throughout the book.

However, it should be pointed out that on page XXV, they make an explicit distinction, to wit:

"The VBE provides users with much more help than was previously available. For example, as you write code, pop-ups appear with lists of appropriate methods and properties for objects, and arguments and parameter values for functions and methods."

Tks.

Al
Reply With Quote
  #2 (permalink)  
Old October 8th, 2011, 10:01 AM
Registered User
Points: 12, Level: 1
Points: 12, Level: 1 Points: 12, Level: 1 Points: 12, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2011
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Default

I´ve just googled that question and found several explanations.

It looks like "parameter" refers to the logical structure of a procedure (and, perhaps, a method), and that "argument" refers to the value taken by a given "parameter".

Did I get it right?

Tks.
Reply With Quote
  #3 (permalink)  
Old October 8th, 2011, 12:01 PM
Friend of Wrox
Points: 689, Level: 9
Points: 689, Level: 9 Points: 689, Level: 9 Points: 689, Level: 9
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2010
Posts: 171
Thanks: 0
Thanked 14 Times in 14 Posts
Default

they basically mean the same thing, at least virtually all the time.

different programming languages use different terminology. I'm a bit rusty with VBA terminology, but the two in question would be Subroutines and Functions.

here's a subroutine (that does nothing useful):

Code:
Sub AddTwoNumbers(Number1 As Integer, Number2 As Integer)

    Dim Result As Integer
    
    Result = Number1 + Number2

End Sub
i think, technically, you got it spot on, but in reality, they are used interchangeably. Number1 and Number2 are the parameters for the above subroutine. If you see "argument", just keep in mind that it's just "stuff" (integers, strings, the list can get really long) passed to a sub or function.

Don't worry too much about that "method signature" stuff you may have encountered in your google search. It will never come up in VBA, though being a professor, if you're curious, a method signature refers only to the return type and parameter types of a function/sub. For example:

Code:
Function Example(Words As String, SomeObject As WorksheetFunction, SomeRange As Range, SomeNumber As Long) As Boolean
    Example = True
End Function
the method signature of the above function would be:

String, WorksheetFunction, Range, Long as Boolean

method signatures have to do with concepts foreign to VBA such as overloading, delegates, anonymous types, and no, i'm not explaining those, lol.

i've learned a lot from people who have freely shared their knowledge online, in appreciation, i try to give back. So if you have other questions, post to this forum, it should be a while before you continuously stump me for answers.

good luck on your journey into the world of programming. :)

p.s. This response was written in camelCase, another term you may encounter if you end up outside the world of VBA. ;)
Reply With Quote
The Following User Says Thank You to mtranchi For This Useful Post:
Prof Alvaro Hernandez (October 10th, 2011)
  #4 (permalink)  
Old May 6th, 2012, 11:42 AM
Registered User
Points: 12, Level: 1
Points: 12, Level: 1 Points: 12, Level: 1 Points: 12, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2011
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Wink

Thanks. (Better late than never!)
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Confusion with terminology... vb89 XML 5 May 7th, 2010 07:36 AM
Terminology? jacob C# 3 July 28th, 2005 04:33 PM



All times are GMT -4. The time now is 06:57 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.