Working with variables in ASP

June 21, 2006

OK here's a short one, this example shows you how do the basics with variables, it demonstrates how to do a simple bit of maths on a shopping cart.
<%

dim vCART,vSHIPPING,vTOTAL

vCART = 47.99 'this variable would hold the total cart price including VAT, you would probably hold this information in a session variable but for this example I have hard coded the price in

vSHIPPING = 3.99
vTOTAL = vCART+vSHIPPING 'this variable will give the total price including shipping

%> 

To write the total out on the web page all you have to do is:-

<%=vTOTAL%> 

And thats it. 

Entry Filed under: ASP. .

3 Comments Add your own

Leave a Comment

Required

Required, hidden

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackback this post  |  Subscribe to the comments via RSS Feed


Calendar

June 2006
M T W T F S S
    Jul »
 1234
567891011
12131415161718
19202122232425
2627282930  

Most Recent Posts