Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 16th, 2012  |  syntax: None  |  size: 0.72 KB  |  hits: 15  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Getting variable of Public Property from external script
  2. 'External Code
  3. Set nObj = New Test
  4. Response.Write(nObj.tValue)
  5.  
  6. 'The Class
  7. Class Test
  8.     Public Test1
  9.  
  10.     Public Property Get tValue
  11.         tValue = Test1
  12.     End Property
  13.  
  14.     Sub Loadit
  15.         Test1="123"
  16.     End Sub
  17. End Class
  18.        
  19. 'External Code
  20. Set nObj = New Test
  21. Response.Write("tValue = " & nObj.tValue)
  22.  
  23. 'The Class
  24. Class Test
  25.     Private Test1
  26.  
  27.     Public Property Get tValue
  28.         tValue = Test1
  29.     End Property
  30.  
  31.     Public Sub Class_Initialize
  32.         Test1 = "123a"
  33.     End Sub
  34. End Class
  35.        
  36. 'External Code
  37. Set nObj = New Test
  38. nObj.Loadit
  39. Response.Write(nObj.tValue)
  40.        
  41. 'External Code
  42.  Set nObj = New Test
  43.  
  44.  Call nObj.Loadit
  45.  
  46.  Response.Write(nObj.tValue)