?
Solved

User Defined Type in ASP

Posted on 2008-06-09
2
Medium Priority
?
1,555 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 53

Accepted Solution

by:
Ryan Chong earned 500 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

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

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

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/…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

771 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