Print Page | Close Window

Functions in asp?

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=8234
Printed Date: 01 April 2026 at 2:32am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Functions in asp?
Posted By: adnan248999
Subject: Functions in asp?
Date Posted: 19 December 2003 at 11:01pm

Hello everyone I am quite comfortable with asp now but there are a couple of things that I don't know how to to  one them being: How would I create a function in asp and access it later can anyone show me an example on a seriously simple function and how to call it that would be great

Thanx



-------------
They call me Bruce Lee



Replies:
Posted By: cybermaster
Date Posted: 20 December 2003 at 2:45am

<%
Function fun_name(ByVal blabal)

response.write(blabal)

End Function
%>

examp:

<%
fun_name(blabalabladd)
%>



-------------
http://www.toxiclab.org - Toxiclab.org -webmasters community


Posted By: adnan248999
Date Posted: 20 December 2003 at 10:13am
Originally posted by cybermaster cybermaster wrote:

<%
Function fun_name(ByVal blabal)

response.write(blabal)

End Function
%>

examp:

<%
fun_name(blabalabladd)
%>

 

Hmm I clearly understand that but why use byVal? What does it mean ? If i wanted a function to display the time I wouldn;t use byVal would I?



-------------
They call me Bruce Lee


Posted By: Semikolon
Date Posted: 20 December 2003 at 10:53am


<%
Function MyFunction(Variable1, Variable2)

Response.Write"     <table>"
Response.Write"       <tr>"
Response.Write"       &am p;nb sp; <td width=" & Variable1 & " bgcolor=" & Variable2 & ">hahaha"
Response.Write"       &am p;nb sp; </td>"
Response.Write"       </tr>"
Response.Write"     </table>"

End Function
%>

 


<% Call MyFunction("100%", "#000000") %>

 

the variables are optional



Posted By: Semikolon
Date Posted: 20 December 2003 at 10:55am

and you can name them whatever you want..

the data in the function can be written in standard html, but then remember to end the asp block before the data..



Posted By: adnan248999
Date Posted: 20 December 2003 at 2:37pm
cool thanx a lot

-------------
They call me Bruce Lee



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net