Using the Script
Ok, now we can use the script in ASP. Your ASP
file should look something like this -
<%
Set objWSC = CreateObject("testscript.wsc")
Response.Write(objWSC.Print("Hello"))
Response.Write(objWSC.CalcTax(5.20) & "<br>")
'Response.Write(objWSC.privated & "<br>")
%> |
This code should be familiar to you. It
creates the object like any other ASP component and then we proceed to print various
things to the screen -
Hello Printed by WSC
5.85
I commented out the last line because you will
get an error (because, if you remember, it's a private property). Also, we used
CalcTax instead of Tax on the second line.
You can also use the Script in
your page if its on another server i.e.
<%
Set objWSC = CreateObject("testscript.wsc", "box2")
%> |
Uses the testscript.wsc on the computer called
box2.