dcsimg
June 20, 2018
Hot Topics:

Pseudo-Objects in Active Server Pages

  • October 14, 1999
  • By Thornton Rose
  • Send Email »
  • More Articles »

<%
' BasicObj.asp - Simple program to show pseudo-object called "Car".

' Force variables to be declared.

option explicit  

' Declare variables.

dim objCar

' Create a Car pseudo-object.

set objCar = Car_New()
objCar("make") = "Toyota"
objCar("model") = "Corolla"
objCar("year") = 1991

' Show the car.

Response.Write "objCar: " & objCar("year") & " " & objCar("make") & " " & _
   objCar("model") & vbCrLf

' -----------------------------------------------------------------------------

' Car_New(): Creates a new, empty Car object.
'
function Car_New()
   dim objCar

   ' Create Dictionary object as base.

   set objCar = Server.CreateObject("Scripting.Dictionary")

   ' Add fields.

   objCar.Add "make",  ""
   objCar.Add "model", ""
   objCar.Add "year",  0

   ' Return the new, empty Car.

   set Car_New = objCar
end function
%>





Page 3 of 11



Comment and Contribute

 


(Maximum characters: 1200). You have characters left.

 

 


Enterprise Development Update

Don't miss an article. Subscribe to our newsletter below.

By submitting your information, you agree that developer.com may send you developer offers via email, phone and text message, as well as email offers about other products and services that developer believes may be of interest to you. developer will process your information in accordance with the Quinstreet Privacy Policy.

Sitemap

×
We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.
Thanks for your registration, follow us on our social networks to keep up-to-date