Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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
like image 532
GaidenFocus Avatar asked Jul 30 '26 16:07

GaidenFocus


1 Answers

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)

like image 130
Bond Avatar answered Aug 02 '26 08:08

Bond



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!