...

View Full Version : ASP Functions - multiple parameters



japangreg
02-01-2005, 05:35 PM
Hi, all.

I'm trying to re-work the members-content of our website to allow visitors to see the documents we have available, but not write the link to the page unless they are logged in.

So I'm trying to write a function that tests the condition of the 'loggedOn' variable, and if true writes a line using the URL of the file and the file name. In order to do this, I need to pass the function 2 parameters but it doesn't seem to want to do it. :(

Here's what I've been working with:

function callBack(url, fileName)
Response.write "<a href='" & url & "'>" & fileName & "</a>" & vbCrLf
end function
Then, in my page I have:
<%callBack("/docs/myFile.asp","My File in ASP")%>
Any ideas as to what I'm doing wrong?

Thanks!

gwendaal
02-01-2005, 07:14 PM
it is more a sub than a function .... there is no returned value
but that is not the error

sub callBack(url, fileName)
Response.write "<a href='" & url & "'>" & fileName & "</a>" & vbCrLf
end sub


<%CALL callBack("/docs/myFile.asp","My File in ASP")%>

japangreg
02-01-2005, 07:32 PM
Thanks, Gwendaal. That fixed it.

=^_^=



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum