Can you execute classes in vbscript and ASP?

Is there a way to do something like classes in vbscript. I'm not so good at classic ASP. Or someone has a C # vbscript conversion FAQ. My problem is that I have to consume the web service in classic ASP, and the return type is an array of the class. In asp.net with C #, this is a piece of cake because I know how to do it, but how do you do it in classic ASP?

+3
source share
3 answers

You can, but just remember that there is no inheritance.

inside your class, constructor and destructors follow.

Class_Initialize()
Class_Terminate()

See http://msdn.microsoft.com/en-us/library/4ah5852c%28VS.85%29.aspx

+3
source

- , , . , vbscript. -?

Class Fubar


 Private m_var 

  Public Function set_one_type(stringtype)
 m_var = stringtype 
  End Function

  Public Function get_one_type 
 get_one_type = m_var 
  End Function 



  Public Function myBox(strMsg)  
 myBox = "Hej " & strMsg
  End Function
End Class

:

Set myFubar = new Fubar
myFubar.set_one_type("Volvo") 

Response.Write(myFubar.get_one_type()) 
+1

You can create classes in VBScript, just like in VB (with clearly more limited VBScript syntax).

See the Download Page for a Wrox VBScript link (which is a great link, BTW). In it you will find the source code for the full chapter of VBScript classes and examples.

In particular, you will need Chapter 8.

0
source

Source: https://habr.com/ru/post/1732490/


All Articles