Jump to content

newbie with functions


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 post
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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...