Solved

User Defined Type in ASP

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

758 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

21 Experts available now in Live!

Get 1:1 Help Now