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
-
AMD : Out of Bounds (OOB) read vulnerability in TPM 2.0 CVE-2025-2884
by
Alex5723
7 minutes ago -
Totally remove or disable BitLocker
by
CWBillow
47 minutes ago -
Windows 10 gets 6 years of ESU?
by
n0ads
2 hours, 59 minutes ago -
Apple, Google stores still offer China-based VPNs, report says
by
Nibbled To Death By Ducks
10 hours, 54 minutes ago -
Search Forums only bring up my posts?
by
Deo
11 hours, 7 minutes ago -
Windows Spotlight broken on Enterprise and Pro for Workstations?
by
steeviebops
22 hours, 36 minutes ago -
Denmark wants to dump Microsoft for Linux + LibreOffice
by
Alex5723
15 hours, 12 minutes ago -
How to get Microsoft Defender to honor Group Policy Setting
by
Ralph
23 hours, 12 minutes ago -
Apple : Paragon’s iOS Mercenary Spyware Finds Journalists Target
by
Alex5723
1 day, 9 hours ago -
Music : The Rose Room – It’s Been A Long, Long Time album
by
Alex5723
1 day, 10 hours ago -
Disengage Bitlocker
by
CWBillow
1 day ago -
Mac Mini M2 Service Program for No Power Issue
by
Alex5723
1 day, 12 hours ago -
New Win 11 Pro Geekom Setup questions
by
Deo
11 hours, 3 minutes ago -
Windows 11 Insider Preview build 26200.5651 released to DEV
by
joep517
1 day, 19 hours ago -
Windows 11 Insider Preview build 26120.4441 (24H2) released to BETA
by
joep517
1 day, 19 hours ago -
iOS 26,, MacOS 26 : Create your own AI chatbot
by
Alex5723
1 day, 23 hours ago -
New PC transfer program recommendations?
by
DaveBoston
4 hours, 33 minutes ago -
Windows 11 Insider Preview Build 22631.5545 (23H2) released to Release Preview
by
joep517
2 days, 3 hours ago -
Windows 10 Build 19045.6029 (22H2) to Release Preview Channel
by
joep517
2 days, 3 hours ago -
Best tools for upgrading a Windows 10 to an 11
by
Susan Bradley
1 day, 16 hours ago -
The end of Windows 10 is approaching, consider Linux and LibreOffice
by
Alex5723
20 hours, 6 minutes ago -
Extended Windows Built-in Disk Cleanup Utility
by
bbearren
1 day, 5 hours ago -
Win 11 24H2 June 2025 Update breaks WIFI
by
dportenlanger
2 days, 22 hours ago -
Update from WinPro 10 v. 1511 on T460p?
by
CatoRenasci
1 day, 20 hours ago -
System Restore and Updates Paused
by
veteran
3 days, 1 hour ago -
Windows 10/11 clock app
by
Kathy Stevens
2 days, 12 hours ago -
Turn off right-click draw
by
Charles Billow
3 days, 4 hours ago -
Introducing ChromeOS M137 to The Stable Channel
by
Alex5723
3 days, 7 hours ago -
Brian Wilson (The Beach Boys) R.I.P
by
Alex5723
14 hours, 39 minutes ago -
Master patch listing for June 10, 2025
by
Susan Bradley
3 days, 9 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.