Pound and Kilos Conversion component

Overview

This basically has two methods one for converting from pounds to kilos and another from kilos to pounds , this is a nice example of building a conversion component .

Sample code

The sample takes 2 predetermined values and converts them , in the real world you could retrieve the values from a form.

<%
'declare our variables
Dim objPoundKilo , value1 , value2
'create an instance of our object
Set objPoundKilo = Server.CreateObject("PoundKilo.Convert")
'set a couple of values
value1 = 20
value2 = 44
'convert the values
Response.Write value1 & " pounds is equal to " & objPoundKilo.PoundToKilo(value1) & " kilos <br>"
Response.Write value2 & " kilos is equal to " & objPoundKilo.KiloToPound(value2) & " pounds <br>"
'destroy the object variable
Set objPoundKilo = Nothing
%>

Download

Right - Click and save

PoundKilo.wsc

Books