[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

User Defined Type in ASP

Posted on 2008-06-09
2
Medium Priority
?
1,559 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
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…
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…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

650 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