這是我在ASP代碼級的每個屬性我都用這個:更簡單的方法來定義經典ASP中的屬性?
Public Property Get ItemsOnPage()
ItemsOnPage = m_ItemsOnPage
end Property
Public Property Let ItemsOnPage(inp)
m_ItemsOnPage = inp
End Property
這個例子是針對ItemsOnPage財產。有什麼其他方式可以讓我以某種方式使用子程序?我試着使用:
sub subClassProperty(varProperty)
execute("Public Property Get " & varProperty & "()")
execute(varProperty & " = m_" & varProperty)
execute("end Property")
execute("Public Property Let " & varProperty & "(inp)")
execute("m_" & varProperty & " = inp")
execute("End Property")
end sub
,但這一分,我不能從一流的呼叫: - ((
聽起來你可以存儲鍵/值對'Dictionary'對象後? –
不,我希望能夠更輕鬆地編寫課程,而不是使用6行來定義一個屬性。 – Jerry2
我擔心這樣的事情在VBScript中是不可能的。但是,如果您更喜歡類C語法,則可以使用JScript編寫經典的ASP。您可以使用JScript編寫該類並從VBScript代碼中使用該類。 –