Ver Mensaje Individual
  #2 (permalink)  
Antiguo 22/05/2006, 06:10
tammander
 
Fecha de Ingreso: enero-2006
Ubicación: Torroles (Costa der Só)
Mensajes: 1.017
Antigüedad: 19 años, 4 meses
Puntos: 7
En ASP puedes usar clases (ya que, creo, no hay otra forma de OOP en ASP que no sea a traves de clases) de forma muy similar a como se hace en PHP (permite metodos y propiedades):

Código:
class library

   Private vdbConn 
   Private vRst 
   Private vConStr 
   Private vSQL
   public InsertButton
   public TdSize
	
	
   'Constructor => set the default values. Ejemplo:
private sub Class_Initialize()
     vAddLink = False
     vAllowPaging = False
     vShowNavigation = False
     vAutoAddColumns = True
end sub
	
   - Destructor => Cierra, elimina, termina con todo aquello que quede sin cerrar. Ejemplo:
   Private Sub Class_Terminate()
   	 if isObject(vRst) then
     	vRst.Close
     	Set vRst = Nothing
	 end if
	
	if isObject(vdbComm) then
	 if vdbConn.State = adStateOpen then vdbConn.Close
     Set vdbConn = Nothing
	end if 
   End Sub
	'******************************************************************************************************************
	'' @SDESCRIPTION: 	Generates a transparent dummy-image which can be used as place-holder. 
	'' @PARAM:			- width [int]: width of the spacer
	'' @PARAM:			- height [int]: height of the spacer
	'' @RETURN:			[string] string with the HTML-IMG-Tag
	'******************************************************************************************************************
	public function spacer(width, height)
		spacer = "<IMG SRC=""images/libClassSpacerImage.gif"" BORDER=0 WIDTH=" & width & " HEIGHT=" & height & ">"
	end function

end class

Luego para usarlo no tienes mas que crearlo

set objeto = new library

A diferencia de PHP, ASP no acepta abstracciones. De igual forma que PHP no acepta polimorfismo.


Un saludo
__________________
"Tus pecados son el estiércol sobre el que florecerán las flores de tus virtudes" - Gerald Messadié -