SAMPLE ACTIVE SERVER PAGE SCRIPT: DISPLAY
LABEL
This example demonstrates using Address 2000 to generate an address
label using data supplied from an input form. You can also find
this example in the examples directory of an Address 2000 installation
which you can place on your web server to test Address 2000 or to use
as a starting point for your own ASP script.
<html>
<head>
<meta name="VI60_defaultClientScript" content="VBScript">
<title></title>
</head>
<body style="font-family:Tahoma">
<form>
Address Label:
<table width="61%" bgcolor="#FFFFCC" border="0" rules
= none cellpadding=0>
<tr>
<td width="2%"> </td>
<td width="150%" > </td>
<td width="24%" rowspan="2"> </td>
</tr>
<tr>
<td width="2%"> </td>
<td width="150%">
<div align="left">
<table border="0" width="100%" bgcolor="#FFFFCC" rules
= none>
<tr>
<td width="218" bgcolor="#FFFFCC">
<%
dim Component,strCRLF, lAvailMode, lCountryIndex, strTemp
dim strUAFD, nLooper, nLabelRows, strLabel, strLabelRow, nFieldCount
dim strField, lFieldPosition, strPassedUAFD
Set Component = Server.CreateObject("Address2000.A2000")
if Component is nothing then
Response.Write("Error creating
A2K object")
Response.End
end if
strPassedUAFD=Request.Form("PassedUAFD")
if strPassedUAFD="" then
lAvailMode=Session("AvailMode")
lCountryIndex=Session("CountryIndex")
Component.CountryMode=lAvailMode
Component.SelectCountry(lCountryIndex)
'Make Label/UAFD from address fields
nFieldCount=Component.FieldCount
for nLooper=1 to nFieldCount
strTemp="Field" & nLooper
strField=Request.Form(strTemp)
Component.AddressField(
CLng(nLooper))= CStr(strField)
Next
Component.FormatData
else
Component.DecodeUAFD(strPassedUAFD)
end if
strLabel=""
strCRLF=chr(13) & chr(10)
nLabelRows=Component.LabelRowCount
for nLooper = 1 to nLabelRows
strLabelRow=Component.LabelRow((clng(nLooper)))
strLabel = strLabel & strLabelRow & " <br>" &strCRLF
next
Response.Write(strLabel)
Set Component =nothing
%> </td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td width="26%" > </td>
<td width="174%" colspan="2"> </td>
</tr>
</table>
<p>
<a HREF="A2000_2.asp">Back to Internet Products</a>
</form>
</body>
</html>
|