3

I'm working with a very weird version of VB...it doesn't want me telling it what is what, it wants to figure that out on its own.

In C# I can easily hard code an array...not so much in this VB.

I would like to create a hard coded array while calling the function...but I'm not sure about the syntax. Can't find much on this specific VB version. It doesn't let you declare types. Anyone here know how to do this? If so, thanks!

        FUNCTION HasInput(filters())
            HasInput = False
            FOR EACH table IN filters
                FOR EACH key IN Request.Form
                    IF LEFT(key, LEN(table)) = table AND Request.Form(key) <> "" THEN
                        HasInput = TRUE
                    END IF
                NEXT
            NEXT

        END FUNCTION

IF HasInput({"ih", "hdms"}) THEN
GaidenFocus
  • 353
  • 4
  • 12
  • 1
    `RETURN TRUE` indicates that the code is **not** (meant as) VBScript. If @Bond's answer works, use `HasInput = True` (assignment to function name) instead. – Ekkehard.Horner Jul 09 '15 at 19:35

1 Answers1

2

Use the Array() function:

If HasInput(Array("ih", "hdms")) Then

And to recieve the array:

Function HasInput(filters)

(though you can still use filters() if it makes it clearer that you're passing an array)

Bond
  • 16,071
  • 6
  • 30
  • 53
  • Thanks dude! Also I just learned that RETURN is a no no. HasInput = True/False is what I changed it to. Appreciate the help. – GaidenFocus Jul 09 '15 at 19:33