Property Get 语句声明 Property 过程的名称,参数以及构成其主体的代码,该过程获取一个属性的值。Property Let 语句声明 Property Let 过程的名称,参数以及构成其主体的代码,该过程给一个属性赋值。
Property Get 语句示例
该示例使用 Property Get 语句,定义获取属性值的属性过程。该属性用一个字符串来标识画笔的当前颜色。Dim CurrentColor As Integer
Const BLACK = 0, RED = 1, GREEN = 2, BLUE = 3'用一个字符串返回画笔的当前颜色。
Property Get PenColor() As String
   Select Case CurrentColor
      Case RED
         PenColor = "Red"
      Case GREEN
         PenColor = "Green"
      Case BLUE
         PenColor = "Blue"
   End Select
End Property'下面的代码通过调用 Property Get 过程
'来获取画笔的颜色。
ColorName = PenColorProperty Let 语句示例
该示例使用 Property Let 语句,定义给属性赋值的过程。该属性标识绘图盒的画笔颜色。Dim CurrentColor As Integer
Const BLACK = 0, RED = 1, GREEN = 2, BLUE = 3'设置绘图盒的画笔颜色属性。
'模块级变量 CurrentColor 设为
'用于绘图的颜色值。
Property Let PenColor(ColorName As String)
   Select Case ColorName   '检查颜色名称字符串。
      Case "Red"
         CurrentColor = RED   '设为 Red。
      Case "Green"
         CurrentColor = GREEN   '设为 Green。
      Case "Blue"
         CurrentColor = BLUE   '设为 Blue。
      Case Else
         CurrentColor = BLACK   '设为缺省值。
   End Select
End Property'下面的代码通过调用 Property let 过程
'来设置绘图盒的 PenColor 属性。PenColor = "Red" 

解决方案 »

  1.   

    Public Property Let Maxpoint(num As Integer)
    这一过程给Maxpoint属性赋值为num.
    Public Property Get Maxpoint() As Integer
    这一过程使得在类外面得到Maxpoint的值。
    msdn中在索引页面输入Property Let和Property Get可以得到更多帮助
      

  2.   

    那在asp里怎么引用这个呢,比如Public Property Let Maxpoint(num As Integer)如何给其赋值呢
      

  3.   

    具体的说就是
    Public Property Let Maxpoint(num As Integer)
    这一过程给Maxpoint属性赋值为num.这个过程在asp中怎么用我不懂
      

  4.   

    在asp中使用时,创建一个对象,然后赋值就可以了
    dim x as new classXX
    x.maxpoint=yy
    这导致在类内执行过程
    Public Property Let Maxpoint(num As Integer)
      Max = num
    End Property
    如果
    yy=x.maxpoint
    则导致在类内执行过程
    Public Property Get Maxpoint() As Integer
      Maxpoint = Max
    End Property