GaidenFocus
GaidenFocus

Reputation: 373

VBScript in Classic ASP

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

Upvotes: 3

Views: 377

Answers (1)

Bond
Bond

Reputation: 16321

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)

Upvotes: 2

Related Questions