Solved

User Defined Type in ASP

Posted on 2008-06-09
2
1,547 Views
Last Modified: 2010-04-21
I am trying to replicate one of my VB codes to be used on our company's website. The code uses user defined type eg

Public Type CustomerPricing
    ProductCode As String
    Barcode As String
    ProductName As String
    ProductDescription As String
    CurrentStock As Long
    Price As Currency
    BreakQuantity1 As Long
    BreakPrice1 As Currency
    BreakQuantity2 As Long
    BreakPrice2 As Currency
    BreakQuantity3 As Long
    BreakPrice3 As Currency
    BreakQuantity4 As Long
    BreakPrice4 As Currency
    QCRequired As Boolean
    SalesUnit As String
    SalesUnitConversion As Long
    ExpiryDate As Date
    DueDate As Date
    EffectiveDate As Date
End Type

How can I replicate this type definition in ASP. Please do not give me ASP.NET solutions. Am purely after simple ASP solutions.

Thanks.
Public Type CustomerPricing
    ProductCode As String
    Barcode As String
    ProductName As String
    ProductDescription As String
    CurrentStock As Long
    Price As Currency
    BreakQuantity1 As Long
    BreakPrice1 As Currency
    BreakQuantity2 As Long
    BreakPrice2 As Currency
    BreakQuantity3 As Long
    BreakPrice3 As Currency
    BreakQuantity4 As Long
    BreakPrice4 As Currency
    QCRequired As Boolean
    SalesUnit As String
    SalesUnitConversion As Long
    ExpiryDate As Date
    DueDate As Date
    EffectiveDate As Date
End Type

Open in new window

0
Comment
Question by:shankar_nr
2 Comments
 
LVL 51

Accepted Solution

by:
Ryan Chong earned 125 total points
ID: 21748343
try use class, like:

test.asp:

<!-- #include file="myclass.asp"-->
<%
      Dim myCustPricing
      
      Set myCustPricing = New clsCustomerPricing
      
      myCustPricing.ProductCode = "A2914843"
      myCustPricing.BarCode = "7775222AFD"
      response.write myCustPricing.ProductCode & ": " & myCustPricing.BarCode
      
      set myCustPricing = Nothing
%>


myclass.asp:

<%
      Class clsCustomerPricing

      private cProductCode, cBarcode, cProductName, cProductDescription, cCurrentStock
      private cPrice, cBreakQuantity1, cBreakPrice1, cBreakQuantity2, cBreakPrice2, cBreakQuantity3, cBreakPrice3, cBreakQuantity4, cBreakPrice4
      private cQCRequired, cSalesUnit, cSalesUnitConversion, cExpiryDate, cDueDate, cEffectiveDate
      
      Public Property Let ProductCode(uProductCode)
            cProductCode = uProductCode
      End Property      
      Public Property Get ProductCode()
            ProductCode = cProductCode
      End Property
      
      Public Property Let Barcode(uBarcode)
            cBarcode = uBarcode
      End Property      
      Public Property Get Barcode()
            Barcode = cBarcode
      End Property

      
      private sub Class_Initialize()
            cProductCode = ""
            cBarcode = ""
            cProductName = ""
            '...
      end sub
 
      private sub Class_Terminate()
            
      end sub

End Class
%>


hope this helps
0
 
LVL 2

Author Closing Comment

by:shankar_nr
ID: 31465610
excellent. yeah that worked and guess will be the way i will go. thanks a lot Johor
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Send to Print Preview database record with one click 3 61
Auto Submit on dropdown box 3 79
Index on a Table 6 25
Load data upon clicking a button 8 35
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question