cheap nfl jerseys china cheap nfl jerseys free shipping wholesale nfl jerseys china wholesale jerseys from china cheap nfl jerseys free shipping cheap nfl jerseys for sale cheap jerseys free shipping wholesale nfl jerseys from china cheap nfl jerseys sale cheap nike nfl jerseys china wholesale jerseys free shipping cheap nfl jerseys wholesale wholesale nfl jerseys online cheap nfl jerseys wholesale china jerseys wholesale cheap coach handbags outlet authentic designer handbags cheap coach handbags outlet cheap coach purses outlet discount coach bags coach bags sale coach purse outlet cheap real coach purses coach handbags sale online coach purse outlet michael kors outlet online store cheap michael kors bags cheap michael kors purse michael kors factory outlet online cheap michael kors handbags cheap michael kors purses michael kors bags outlet online cheap michael kors purse michael kors handbags discount
oggetto semplice senza metodi

creazione dell'oggetto

Class Car Public Color Public CurrentSpeed Public LightsOn End Class

creazione di un'istanza dell'oggetto

Dim objMyCar Set objMyCar = New Car obj.MyCar.Color = "Red"

oggetto semplice con metodi

creazione dell'oggetto

Class Car Public Color Public CurrentSpeed Public LightsOn Public Sub Accelerate(PercetAccel) CurrentSpeed = CurrentSpeed * (1 + PercentAccel * 0.01) End Sub End Class

creazione di un'istanza dell'oggetto

Dim objMyCar Set objMyCar = New Car obj.MyCar.CurrentSpeed = 30 obj.MyCar.Accelerate(50)

oggetto con propriet� e metodi nascosti

creazione dell'oggetto

Class Car private internal_color private internal_speed private internal_lights private Sub Class_Initialize() internal_color = "WHITE" internal_speed = 0 internal_lights = FALSE End Sub public Property Get CurrentSpeed CurrentSpeed = internal_speed End Property public Property Let CurrentSpeed (ByVal iSpeedIn) internal_speed = iSpeedIn End Property public Property Get Color Color = internal_color End Property public Property Let Color (ByVal strColorIn) internal_color = Ucase(strColorIn) End Property public Sub TurnLightsOn internal_lights = True End Sub public Sub TurnLightsOff internal_lights = False End Sub public Function CheckLights if internal_lights then CheckLights = "ON" else CheckLights = "OFF" endi iF End Function public Sub Accelerate(PercetAccel) Dim sngMultiplier sngMultiplier = (1 + PercentAccel * 0.01) internal_speed = internal_speed * sngMultiplier End Sub End Class

creazione e uso di un'istanza dell'oggetto

<%@ Language=VBScript %> <% Option Explicit %> <HTML><BODY> <!--#include file="CarDefinition.asp"--> <% Dim objMyCar Set objMyCar = New Car Response.Write("My car is " & objMyCar.Color & "<br>") Response.Write("the lights are " & objMyCar.CheckLights & "<br>") objMyCar.CurrentSpeed = 44 Response.Write("the car is travelling at " & objMyCar.CurrentSpeed & ".<P>") objMyCar.Accelerate(25) objMyCar.TurnLightsOn objMyCar.Color = "blue" Response.Write("Now the car is travelling at " & objMyCar.CurrentSpeed & ", ") Response.Write("the lights are " & objMyCar.CheckLights & " and ") Response.Write("the color is " & objMyCar.Color & ".") Set objMyCar = Nothing %>