I am looking for a general snippet that can be used to capture in an array, the arguments which were passed to the current procedure or function. I visualize something akin to the following, but do not know of any way to determine properties of a procedure such as which arguments were passed to it.
Any insight will be greatly appreciated.
[codebox] For ctr = 1 To PassedArguments.Count
myArray(ctr) = PassedArguments(ctr)
Next
[/codebox]
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Capturing Arguments passed to a Procedure
Home » Forums » AskWoody support » Productivity software by function » Visual Basic for Applications » Capturing Arguments passed to a Procedure
- This topic has 7 replies, 6 voices, and was last updated 16 years, 3 months ago.
AuthorTopicDon Wells
AskWoody LoungerMarch 1, 2009 at 8:18 am #457915Viewing 2 reply threadsAuthorReplies-
WSHansV
AskWoody Lounger -
Don Wells
AskWoody Lounger -
WSrory
AskWoody LoungerMarch 3, 2009 at 5:12 am #1149843Thank you Hans
I have come to the same conclusion. Passing the array as an argument achieves the desired results with no added agony.If you were not using ParamArray, then you could simply declare the array and populate it as required given that you know at design time what the inputs are. I’m not really sure what purpose it would serve though?
-
-
-
WSpieterse
AskWoody LoungerMarch 3, 2009 at 8:31 am #1149876What I sometimes do is use a custom type. This makes adding an argument simple:
[codebox]Option Explicit
Public Type People
FirstName As String
LastName As String
Street As String
End TypeSub Example()
Dim tPerson As People
With tPerson
.FirstName = “Jan”
.LastName = “Pieterse”
.Street = “Churchlane”
End With
ShowPerson tPerson
End SubSub ShowPerson(tPerson As People)
With tPerson
MsgBox .FirstName & ” ” & .LastName & vbNewLine & .Street
End With
End Sub
[/codebox] -
WSchrisgreaves
AskWoody LoungerMarch 3, 2009 at 8:59 am #1149882What I sometimes do is use a custom type.
Me too.
In particular, within a VBA project, or better yet, within a client’s project (which may consist of several VBA Application projects), if I can create a self-descriptive TYPE, I can do all sorts of useful debugging things.
A self-descriptive TYPE being one where the first item is, say, a LONG that describes the number of dimensions of a parameter array, the next Val(lng) items are the size of each dimension, and then next item is the array.
Or sometimes, paired items that tell me the type as well as the dimension.
And so on.MARC library records were a popular example of this technique years ago.
I wish that VBA made available to us poor mortals the descriptors of data, so we could interrogate them instead of relying on trial and On Error.
-
-
WSAlanMiller
AskWoody LoungerMarch 4, 2009 at 6:28 am #1150029I am looking for a general snippet that can be used to capture in an array, the arguments which were passed to the current procedure or function.
I’m not sure what you’re wanting to do here, but I’ve often used the Join and Split functions to “carry” multiple values in a single (global?) variable, which can be easily transformed to an array. See VB String Array Functions – Split, Join, Filter (VB6) for example.
Alan
-
Don Wells
AskWoody LoungerMarch 4, 2009 at 8:17 pm #1150279I’m not sure what you’re wanting to do here, but I’ve often used the Join and Split functions to “carry” multiple values in a single (global?) variable, which can be easily transformed to an array. See VB String Array Functions – Split, Join, Filter (VB6) for example.
Alan
Thanks for the input Alan
As soon as I hit the send button on my original post I realized that if I wanted to create an array of arguments in the called procedure, the simplest way would be to create the array in the calling procedure and pass the array.
-
Viewing 2 reply threads -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Tools to support internet discussions
by
Kathy Stevens
1 hour, 10 minutes ago -
How get Group Policy to allow specific Driver to download?
by
Tex265
1 hour, 4 minutes ago -
AI is good sometimes
by
Susan Bradley
1 hour, 31 minutes ago -
Mozilla quietly tests Perplexity AI as a New Firefox Search Option
by
Alex5723
6 hours, 50 minutes ago -
Perplexity Pro free for 12 mos for Samsung Galaxy phones
by
Patricia Grace
1 day, 1 hour ago -
June KB5060842 update broke DHCP server service
by
Alex5723
1 day ago -
AMD Ryzen™ Chipset Driver Release Notes 7.06.02.123
by
Alex5723
1 day, 4 hours ago -
Excessive security alerts
by
WSSebastian42
5 hours, 20 minutes ago -
* CrystalDiskMark may shorten SSD/USB Memory life
by
Alex5723
1 day, 13 hours ago -
Ben’s excellent adventure with Linux
by
Ben Myers
6 minutes ago -
Seconds are back in Windows 10!
by
Susan Bradley
1 day, 1 hour ago -
WebBrowserPassView — Take inventory of your stored passwords
by
Deanna McElveen
7 hours, 34 minutes ago -
OS news from WWDC 2025
by
Will Fastie
4 hours, 56 minutes ago -
Need help with graphics…
by
WSBatBytes
9 hours, 10 minutes ago -
AMD : Out of Bounds (OOB) read vulnerability in TPM 2.0 CVE-2025-2884
by
Alex5723
2 days, 5 hours ago -
Totally remove or disable BitLocker
by
CWBillow
1 day, 4 hours ago -
Windows 10 gets 6 years of ESU?
by
n0ads
1 day, 7 hours ago -
Apple, Google stores still offer China-based VPNs, report says
by
Nibbled To Death By Ducks
2 days, 16 hours ago -
Search Forums only bring up my posts?
by
Deo
44 minutes ago -
Windows Spotlight broken on Enterprise and Pro for Workstations?
by
steeviebops
3 days, 3 hours ago -
Denmark wants to dump Microsoft for Linux + LibreOffice
by
Alex5723
2 days, 20 hours ago -
How to get Microsoft Defender to honor Group Policy Setting
by
Ralph
3 days, 4 hours ago -
Apple : Paragon’s iOS Mercenary Spyware Finds Journalists Target
by
Alex5723
3 days, 14 hours ago -
Music : The Rose Room – It’s Been A Long, Long Time album
by
Alex5723
3 days, 15 hours ago -
Disengage Bitlocker
by
CWBillow
3 days, 5 hours ago -
Mac Mini M2 Service Program for No Power Issue
by
Alex5723
3 days, 17 hours ago -
New Win 11 Pro Geekom Setup questions
by
Deo
33 minutes ago -
Windows 11 Insider Preview build 26200.5651 released to DEV
by
joep517
4 days ago -
Windows 11 Insider Preview build 26120.4441 (24H2) released to BETA
by
joep517
4 days ago -
iOS 26,, MacOS 26 : Create your own AI chatbot
by
Alex5723
4 days, 4 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.