Solved

User Defined Type in ASP

Posted on 2008-06-09
2
1,542 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 49

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
EOF BOF error classic asp 8 43
Send to Print Preview database record with one click 3 49
Need help editing script 3 66
Question about ASP Including Files 6 44
I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

864 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now