Jump to content

newbie with functions


Splurd

Recommended Posts

I'm new to vbscript and I'm doing asp,anyway I read the tutroials and I sorta understood them, but I am not sure how to do what I want.Basicly, I want to create a function, which will return a value depending on what I do.Like, for example comparing value

Function compare(valuehere)if valuehere = "yes" OR valuehere = "y" OR valuehere = "true" OR valuehere = 1 then   ans = trueelse   ans = falseend ifEnd Function

so how do I get ans out, can someone show me an example?

Link to comment
Share on other sites

To return a value from a VBScript function, just assign the value to the name of the function.Function compare(valuehere)if valuehere = "yes" OR valuehere = "y" OR valuehere = "true" OR valuehere = 1 then compare = trueelse compare = falseend ifEnd Function

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...