• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 453
  • Last Modified:

how to pass in a list of string/numbers into a vbs function

I have the following vbs function that accepts a parameter array

Function TEST(Arr())
End Function

The calling function in this system is dynamically generated as a string and then a msscript control invokes it.

How can I call the function and pass in the array by init its values as a string using the following syntax?

Dim numbers = New Integer() {1, 2, 4, 8}
Dim doubles = {1.5, 2, 9.9, 18}


TEST({1,2,3,4}) '<--how can i pass these in as literals?
1 Solution
Bill PrewCommented:
Here is the correct VBS syntax:


Function TEST(Arr())
End Function

Open in new window

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Train for your Pen Testing Engineer Certification

Enroll today in this bundle of courses to gain experience in the logistics of pen testing, Linux fundamentals, vulnerability assessments, detecting live systems, and more! This series, valued at $3,000, is free for Premium members, Team Accounts, and Qualified Experts.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now